home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / tex / tex_docs.zoo / texintro.tex < prev   
Text File  |  1990-09-02  |  193KB  |  5,339 lines

  1. %% Thanks for your interest in A Gentle Introduction to TeX.
  2. %% Any comments on this manual would be appreciated. These may
  3. %% be typesetting, English, or TeX criticisms. If you decide to
  4. %% translate this document into another language, I'd appreciate
  5. %% receiving a copy.
  6. %%
  7. %% This file is a complete TeX input file.  Just run it
  8. %% through TeX and print out the resulting "DVI" file. If you are
  9. %% familiar with TeX, the macros at the top of the file have a few
  10. %% switches which you may want to set.  If you have problems or
  11. %% can't run TeX at all, write to me and I'll send you a hard copy.
  12. %% You can get a bound copy from the TeX Users Group at the address
  13. %% given below.
  14. %%
  15. %% You should feel free to photocopy and/or distribute this manual.
  16. %% My only request is that it remain in one piece and not be chopped
  17. %% up.  The only machine dependent section (#1.2) may need to be
  18. %% rewritten for your local site, of course.
  19. %%
  20. %%%                Michael Doob
  21. %%                 Department of Mathematics
  22. %%                 The University of Manitoba
  23. %%                 Winnipeg, Manitoba  R3T 2N2
  24. %%                 Canada
  25. %%                 mdoob@uofmcc                    (bitnet)
  26. %%                 mdoob@ccu.umanitoba.ca          (internet)
  27. %%
  28. %% Here is a character listing to check to be sure that no
  29. %% unwanted translations took place within the bowels of the net.
  30. %% Upper case letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  31. %% Lower case letters: abcdefghijklmnopqrstuvwxyz
  32. %% round parentheses, square brackets, curly braces: ()  []  {}
  33. %% Exclaim, at, sharp, dollar, percent: ! @ # $ %
  34. %% Caret, ampersand, star, underscore, hyphen: ^ & * _ -
  35. %% vertical bar, backslash, tilde, backprime, plus: | \ ~ ` +
  36. %% plus, equal, prime, quote, colon: + = ' " :
  37. %% less than, greater than, slash, question, comma: < > / ? ,
  38. %% period, semicolon: . ;
  39. %%
  40. %%
  41. %%
  42. %% Now here come the macros used in this manual. If you are
  43. %% already familiar with TeX, you may want to fiddle with them.
  44. %% In particular, the hooks are left to generate a new control
  45. %% word index and table of contents if you change section 1.2.
  46. %%
  47. %%
  48.  
  49.  
  50.  
  51. %%%%%%%% Here are the fonts other than the sixteen defined in %%%%%%%%
  52. %%%%%%%%%%%%%        plain.tex that are used        %%%%%%%%%%%%%%%%%%
  53.  
  54.        %%%% first, choose between amr or cmr fonts %%%
  55. \newif \ifamrfonts
  56. \amrfontsfalse  % use this line if you use the cmr fonts
  57. %\amrfontstrue  % use this line if you use the old amrfonts
  58.  
  59. \ifamrfonts \font\brm=amr10 scaled \magstep1
  60.       \else \font\brm=cmr10 scaled \magstep1 \fi
  61. \ifamrfonts \font\halfrm=amr10 scaled \magstephalf
  62.       \else \font\halfrm=cmr10 scaled \magstephalf \fi
  63. \ifamrfonts \font\bbrm=amr10 scaled \magstep2
  64.       \else \font\bbrm=cmr10 scaled \magstep2 \fi
  65. \ifamrfonts \font\bbbrm=amr10 scaled \magstep3
  66.       \else \font\bbbrm=cmr10 scaled \magstep3 \fi
  67. \ifamrfonts \font\bbbbrm=amr10 scaled \magstep4
  68.       \else\font \bbbbrm=cmr10 scaled \magstep4 \fi
  69. \ifamrfonts \font\bbbbbrm=amr10 scaled \magstep5
  70.       \else \font\bbbbbrm=cmr10 scaled \magstep5 \fi
  71. \ifamrfonts \font\sf = amssmc10
  72.       \else \font\sf = cmss10 \fi
  73. \ifamrfonts \font\chapfont=ambx10 scaled \magstep2
  74.       \else \font\chapfont=cmbx10 scaled \magstep2 \fi
  75. \ifamrfonts \font\secfont=ambx10 scaled \magstep1
  76.       \else \font\secfont=cmbx10 scaled \magstep1 \fi
  77. \ifamrfonts \font\sc= amcsc10
  78.       \else \font\sc= cmcsc10 \fi
  79. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  80.  
  81.  
  82. %%%%\vbadness=10000 %%%%%% I don't want to hear about underfull vboxes
  83. \raggedbottom      %%%%% delete this line for aligned page bottoms
  84. \hsize=5.5in
  85. \vsize=7in
  86. \voffset=.75in
  87. \parskip=\baselineskip
  88. \widowpenalty=1000 \clubpenalty=1000  %%% I hate widows and orphans! %%%
  89.  
  90. %%%%%%%%% choosing between Canadian and American spellings %%%%%%%%%
  91. \newif \ifcanspell
  92. \canspelltrue      %%%% Canadian spelling
  93.  \canspellfalse    %%% use this line for American spelling
  94.  
  95. \def\aesthetic{\ifcanspell \ae{}sthetic\else esthetic\fi}
  96. \def\analogue{\ifcanspell analogue\else analog\fi}
  97.      \let\analog=\analogue
  98. \def\cancelled{\ifcanspell cancelled\else canceled\fi}
  99.      \let\canceled=\cancelled
  100. \def\centimetre{\ifcanspell centimetre\else centimeter\fi}
  101.      \let\centimeter=\centimetre
  102. \def\centre{\ifcanspell centre\else center\fi}
  103.      \let\center=\centre
  104. \def\centred{\ifcanspell centred\else centered\fi}
  105.      \let\centered=\centred
  106. \def\our{\ifcanspell our\else or\fi}
  107. \def\postcode{\ifcanspell postalcode\else zipcode\fi}
  108. \def\province{\ifcanspell province\else state\fi}
  109. \def\theatre{\ifcanspell theatre\else theater\fi}
  110.      \let\theater=\theatre
  111. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  112.  
  113.  
  114. %%%%%%%%%%%%%%%%%%%%%%% headline routines %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  115. \def\gentleheadline{%
  116.     \vbox {\hrule%
  117.         \line {\strut \vrule \quad \tenrm A \TeX{} intro
  118.               \ifcanspell (Canadian \else (U.S. \fi spelling)
  119.               \hfil
  120.               \ifnum \secnum > 0 Section \the\secnum: \fi \sectiontitle \quad
  121.               \vrule}%
  122.         \hrule}%
  123. }
  124.  
  125. \newif \iftitlepage    \titlepagetrue
  126. \headline=
  127.   {\iftitlepage \hfil \global\titlepagefalse \else \gentleheadline \fi}
  128. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  129.  
  130. %%%%%%%%%%%%%%%%%%%% define contents and index files %%%%%%%%%%%%%%%%%%%%%%
  131. %%% Normally the contents and index are hard coded into the input file. %%%
  132. %% To generate new ones, use \writingcontentstrue and \writingindextrue. %%
  133.  
  134. \newif \ifwritingcontents
  135. \newif \ifwritingindex
  136. \newwrite\contents         \newwrite\index
  137.  
  138. \writingcontentsfalse      \writingindexfalse
  139. %%% \writingcontentstrue  %%% use this line to make the contents
  140. %%% \writingindextrue     %%% use this line to make the index
  141.  
  142. \ifwritingcontents \openout\contents=contents.tex     \fi
  143. \ifwritingindex \openout\index=index.tex
  144.           \def\toindex#1{\immediate\write\index{#1 \the\pageno}}
  145.           \else \def\toindex#1{} \fi
  146. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  147.  
  148. %%%%%%%%%%%%%%%%%%%% determine whether answers are printed %%%%%%%%%%%%%%%%
  149. \newif \ifwritinganswers
  150. \writinganswersfalse        %%% use this line to suppress answer section
  151. \writinganswerstrue         %%% use this line to include answer section
  152. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  153.  
  154. %%%%%%%%%%%%%%%%      footnote macro with counter      %%%%%%%%%%%%
  155. \newcount\footnotenum \footnotenum=0
  156. \def\fnote#1{\advance \footnotenum by 1%
  157. \footnote{$^{\the\footnotenum}$}{#1}}
  158. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  159.  
  160.  
  161.  
  162. %%%%%%%%%%%%%%%% exercise, section, and subsection macros %%%%%%%%%%%%
  163. \newcount\exno                   %%%%%% counter for exercises %%%%%%%%
  164. \newcount\secnum \secnum=0       %%%% counter for section numbers %%%%
  165. \newcount\subsecnum
  166.  
  167. \def\section#1{
  168.             \vfill\eject %%%%% new section starts on a new page
  169.             %%%\ifodd\pageno \else\ \vfill\eject \fi %start on an odd page
  170.             \advance\secnum by 1 \subsecnum=0 \exno=0
  171.             \ifnum \secnum = 1 \pageno=1 \fi
  172.             \ifnum \secnum > 0
  173.                  \leftline{\chapfont Section \the\secnum}
  174.                  \vskip 3pt \fi
  175.             \leftline{\chapfont #1}
  176.             \def\sectiontitle{#1}
  177.             \vskip\baselineskip
  178.             \hrule
  179.             \vskip 1cm
  180.             \ifwritingcontents \write\contents{\string\line\string{#1
  181.                    \string\dotfill{}
  182.                    \ifnum \pageno < 0 \romannumeral-\pageno
  183.                    \else \the\pageno \fi
  184.                    \string}}\fi
  185.             \titlepagetrue}
  186.  
  187. \def\subsection#1{\advance\subsecnum by 1
  188.                \vskip 30pt
  189.                \leftline{\secfont \the\secnum .\the\subsecnum\ #1}
  190.                \nobreak
  191.                \ifwritingcontents
  192.                      \write\contents{\string\line\string{\string\qquad{}#1
  193.                      \string\dotfill{} \the\pageno\string}}\fi
  194.                  }
  195.  
  196. \def\exercise{\global\advance \exno by 1
  197.          \vskip\baselineskip
  198.          \noindent $\triangleright$ Exercise \the\secnum.\the\exno\quad
  199.          }
  200. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  201.  
  202.  
  203. %% definitions of control sequences for characters in the typewriter font %%%
  204. %%%% for short phrases this is easier than using a literal construction %%%%
  205. \def\\{\char92{}}          %%%%% backslash %%%%%
  206. \def\lb{\char'173{}}       %%%%% left brace %%%%%
  207. \def\rb{\char'175{}}       %%%%% right brace %%%%%
  208. \def\sp{\char32{}}         %%%%% special space symbol %%%%%
  209.  
  210. \def\beginliteral{
  211. \vskip\baselineskip
  212. \begingroup
  213. \tt
  214. \obeylines
  215. %{\obeyspaces\global\let =\ }
  216. \catcode`\@=0
  217. \parskip=0pt\parindent=0pt
  218. \catcode`\$=12\catcode`\&=12\catcode`\^=12\catcode`\#=12
  219. \catcode`\_=12\catcode`\~=12
  220. \def\par{\leavevmode\endgraf}
  221. \catcode`\{=12\catcode`\}=12\catcode`\%=12\catcode`\\=12
  222. }
  223.  
  224. \def\endliteral{\endgroup}
  225. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  226.  
  227.  
  228. %%%%%%%%%%%%%% inhibit hyphenation of typewriter text %%%%%%%%%%%%%%
  229. \hyphenchar\tentt=-1
  230.  
  231.  
  232. %%%%%%%%%%%% grouping to make input listing in typewriter type %%%%%%%
  233. \def\beginuser{\vskip\parskip
  234.                \everypar={\nobreak}
  235.                \begingroup
  236.                \tt \obeylines \parskip=0pt \parindent=0pt}
  237.  
  238. \def\enduser{\endgroup}
  239.  
  240.  
  241. %%%%%%%%%%% macro to construct tables (easily) %%%%%%%%%%%%%%%%
  242. %%% parameters: title goes between brackets, rest of the
  243. %%%             paragraph is the table
  244. \def\maketable[#1]#2\par{
  245. \setbox1=\vbox{#2}
  246. $$\vbox{
  247.         \hbox to \wd1{\bf \hss #1 \hss}
  248.         \vskip 12pt
  249.         \box1
  250.        }
  251. $$
  252. }
  253. %%%%%%%%%%%  end of macro to construct tables  %%%%%%%%%%%%%%%%
  254.  
  255.  
  256.  
  257. %%%%%%%%%%% macro to put a box around the text %%%%%%%%%%%%%%%%
  258. \def\makebox#1#2#3% vsize, hsize, inserted text
  259. {\hbox{\vrule
  260.        \vbox to  #1{\hrule \vss
  261.                    \hbox to #2{\hss#3\hss}\vss
  262.                    \hrule}\vrule}}
  263.  
  264. \def\displaytext#1{$$\hbox{#1}$$}
  265.  
  266. \def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em
  267.    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
  268.  
  269. \def\AMSTeX{{$\cal A$}\kern-.1667em\lower.5ex\hbox
  270.  {$\cal M$}\kern-.125em{$\cal S$}-\TeX}
  271.  
  272.  
  273. %%%%%%%%%%%% macro to put TeX references in right margin %%%%%%%%
  274. \newdimen\theight
  275. \def \TeXref#1{%
  276.              \vadjust{\setbox0=\hbox{\sevenrm\quad\quad\TeX book: #1}%
  277.              \theight=\ht0
  278.              \advance\theight by \dp0    \advance\theight by \lineskip
  279.              \kern -\theight \vbox to \theight{\rightline{\rlap{\box0}}%
  280.              \vss}%
  281.              }}%
  282. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  283.  
  284. \def\version{1.02}
  285.  
  286. %%%%%%%%%%%% macro to write the date out the date and time %%%%%%%%%%%
  287. %%%%%%%%%%%%          TeXbook   p. 406 for date            %%%%%%%%%%%
  288. \def\today{\ifcase\month\or January\or February\or March\or April\or
  289. May\or June\or July\or August\or September\or October\or November\or
  290. December\fi \space\number\day, \number\year}
  291.  
  292. \newcount\hour \newcount\minute
  293. \hour=\time  \divide \hour by 60
  294. \minute=\time
  295. \loop  \ifnum \minute > 59 \advance \minute by -60 \repeat
  296. \def\writetime{\ifnum \hour<13 \number\hour:%  % supresses leading 0's
  297.                       \ifnum \minute<10 0\fi%  % so add it it
  298.                       \number\minute
  299.                       \ifnum \hour < 12 \ A.M. \else \ P.M. \fi
  300.       \else \advance \hour by -12 \number\hour:%  % supresses leading 0's
  301.                       \ifnum \minute<10 0\fi%     % add it in
  302.                       \number\minute \ P.M. \fi}
  303.  
  304. \def\datestamp{\vfill
  305.     \rightline{\sevenrm Gentle Intro \version{} run through \TeX{}
  306.                on \today{} at \writetime}}
  307. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  308.  
  309. \titlepagetrue
  310. {\nopagenumbers
  311. \def\sectiontitle{Introduction}
  312. \topinsert \vskip 6 cm \endinsert
  313. \centerline{\chapfont A Gentle Introduction to \TeX{}}
  314. \vskip 15 pt
  315. \centerline{\secfont A Manual for Self-study}
  316. \vskip 3cm
  317. \leftline{Michael Doob}
  318. \leftline{Department of Mathematics}
  319. \leftline{The University of Manitoba}
  320. \leftline{Winnipeg, Manitoba, Canada R3T 2N2}
  321. \vskip\baselineskip
  322. \leftline{MDOOB@UOFMCC.BITNET}
  323. \leftline{MDOOB@CCU.UMANITOBA.CA}
  324.  
  325. \vfill\eject
  326. \titlepagetrue.
  327. \vfill\eject
  328. }
  329. \secnum=-2 \pageno=-1
  330.  
  331. \section{Introduction}
  332.  
  333. First the bad news: \TeX{} is a large and complicated program that
  334. goes to extraordinary lengths to produce attractive typeset material.
  335. This very complication can cause unexpected things to happen at times.
  336. Now the good news: straightforward text is very easy to typeset using
  337. \TeX\null.  So it's possible to start with easier text and work up to
  338. more complicated situations.
  339.  
  340. The purpose of this manual is to start from the very beginning and
  341. to move towards these more complicated situations.  No previous knowledge
  342. of \TeX{} is assumed. By proceeding a section at a time, greater
  343. varieties of text can be produced.
  344.  
  345. Here are a few suggestions: there are some exercises in each
  346. section.  Be sure and do them! The only way to learn \TeX{} is
  347. by using it.  Better yet, experiment on your own; try to make
  348. some variations on the exercises.  There is no way that you can
  349. damage the \TeX{} program with your experiments.  You can find a
  350. complete answer to most exercises by looking at the \TeX{} source
  351. file that was used to produce this document.  You'll notice that
  352. there are references in the right margin to {\bf The \TeX
  353. book}\fnote{Addison-Wesley, Reading,Massachusetts, 1984, ISBN
  354. 0-201-13488-9}\null.  When you feel that you want more
  355. information on a topic, that's where to look.
  356.  
  357. Incidentally, there are a few fibs that appear in this manual;
  358. they are used to hide complications (I look at this as something
  359. like poetic license).  As you become more experienced at using
  360. \TeX{}, you'll be able to find them.
  361.  
  362. \TeX{} is a public domain program that is available for no
  363. license fee.  It was developed by Donald Knuth at Stanford
  364. University as a major project. In the profit-oriented market
  365. place, the program would certainly cost many thousands of
  366. dollars.  The \TeX{} Users Group (TUG) is a nonprofit
  367. organization which distributes copies of \TeX{}, this manual,
  368. updates software, and gives information about new developments in
  369. both hardware and software in its publications TUGboat and \TeX
  370. niques.  Joining this users group is inexpensive; please consider
  371. doing so.  The address is:
  372. \vskip\baselineskip
  373. \centerline{\TeX{} Users Group}
  374. \centerline{P.O. Box 9506}
  375. \centerline{Providence, RI 02940}
  376. \centerline{U.S.A.}
  377.  
  378. This manual would not have come into being without the aid of others.
  379. In particular the proofreading and suggestions of the following
  380. people have been invaluable:
  381. \begingroup
  382. \frenchspacing
  383. Waleed A.~Al-Salam (University of Alberta),
  384. Debbie L.~Alspaugh (University of California),
  385. Nelson H.~F.~Beebe (University of Utah),
  386. Barbara Beeton (American Mathematical Society),
  387. Bart Childs (Texas A.~\&~M\null. University),
  388. Mary Coventry (University of Washington),
  389. Dimitrios Diamantaras (Temple University),
  390. Roberto Dominimanni (Naval Underwater Systems Center),
  391. Lincoln Durst (Providence, RI),
  392. Victor Eijkhout (University of Nijmegen),
  393. Moshe Feder (St. Lawrence University),
  394. Josep~M.~Font (Universidad Barcelona),
  395. Jonas de Miranda Gomes
  396.         (Instituto de Matematica Pura e Aplicada - Brazil),
  397. Rob Gross (Boston College),
  398. Klaus Hahn (University of Marburg),
  399. Anita Hoover (University of Delaware),
  400. J\"urgen Koslowski (Macalester College),
  401. Kees van der Laan (Rijksuniversiteit Groningen),
  402. John Lee (Northrop Corporation),
  403. Silvio Levy (Princeton University),
  404. Robert Messer (Albion College),
  405. Emily H.~Moore (Grinnell College),
  406. Young Park (University of Maryland),
  407. Craig Platt (University of Manitoba),
  408. Kauko Saarinen (University of Jyv\"askyl\"a),
  409. Jim Wright (Iowa State University),
  410. and
  411. Dominik Wujastyk (Wellcome Institute for the History of Medicine).
  412.  \endgroup
  413.  
  414. In addition several people have sent me parts or all of their local
  415. manuals.  I have received a few others on the rebound.
  416. In particular
  417. \begingroup
  418. \frenchspacing
  419. Elizabeth Barnhart (TV Guide),
  420. Stephan v.~Bechtolsheim (Purdue University),
  421. Nelson H.~F.~Beebe (University of Utah)
  422.              and Leslie Lamport (Digital Equipment Corporation),
  423. Marie McPartland-Conn and Laurie Mann (Stratus Computer),
  424. Robert Messer (Albion College),
  425. Noel Peterson (Library of Congress),
  426. Craig Platt (University of Manitoba),
  427. Alan Spragens (Stanford Linear Accelerator Center, now of Apple Computers),
  428. Christina Thiele (Carleton University),
  429. and Daniel M.~Zirin (California Institute of Technology)
  430. \endgroup
  431. have written various types of lecture notes that have been most helpful.
  432.  
  433. \vfill \eject
  434. \section{Contents}
  435.  
  436. \line{Introduction \dotfill{} i}
  437. \line{Contents \dotfill{} iii}
  438. \line{1.~Getting Started \dotfill{} 1}
  439. \line{\qquad{}1.1 What \TeX{} is and what \TeX{} isn't \dotfill{} 1}
  440. \line{\qquad{}1.2 From \TeX{} file to readable output,
  441.                                         the big set up \dotfill{} 2}
  442. \line{\qquad{}1.3 Let's do it! \dotfill{} 4}
  443. \line{\qquad{}1.4 \TeX{} has everything under control \dotfill{} 7}
  444. \line{\qquad{}1.5 What \TeX{} won't do \dotfill{} 8}
  445. \line{2.~All characters great and small \dotfill{} 9}
  446. \line{\qquad{}2.1 Some characters are more special than others \dotfill{} 9}
  447. \line{\qquad{}2.2 Typesetting with an accent \dotfill{} 10}
  448. \line{\qquad{}2.3 Dots, dashes, quotes,
  449.        $\textfont0=\tenbf \mathinner {\ldotp \ldotp \ldotp }$ \dotfill{} 13}
  450. \line{\qquad{}2.4 Different fonts \dotfill{} 15}
  451. \line{3.~The shape of things to come \dotfill{} 19}
  452. \line{\qquad{}3.1 Units, units, units \dotfill{} 19}
  453. \line{\qquad{}3.2 Page shape \dotfill{} 20}
  454. \line{\qquad{}3.3 Paragraph shape \dotfill{} 22}
  455. \line{\qquad{}3.4 Line shape \dotfill{} 26}
  456. \line{\qquad{}3.5 Footnotes \dotfill{} 27}
  457. \line{\qquad{}3.6 Headlines and footlines \dotfill{} 28}
  458. \line{\qquad{}3.7 Overfull and underfull boxes \dotfill{} 29}
  459. \line{4.~$\Bigl\{$Groups, $\bigl\{$Groups, $\{$and More%
  460.  \setbox0=\hbox{$\biggl\{$} \vrule height \ht0 depth \dp0 width 0pt
  461.     Groups$\}\bigr\}\Bigr\}$ \dotfill{} 31}
  462. \line{5.~No math anxiety here! \dotfill{} 33}
  463. \line{\qquad{}5.1 Lots of new symbols \dotfill{} 33}
  464. \line{\qquad{}5.2 Fractions \dotfill{} 37}
  465. \line{\qquad{}5.3 Subscripts and superscripts \dotfill{} 38}
  466. \line{\qquad{}5.4 Roots, square and otherwise \dotfill{} 39}
  467. \line{\qquad{}5.5 Lines, above and below \dotfill{} 39}
  468. \line{\qquad{}5.6 Delimiters large and small \dotfill{} 40}
  469. \line{\qquad{}5.7 Those special functions \dotfill{} 41}
  470. \line{\qquad{}5.8 Hear ye, hear ye! \dotfill{} 42}
  471. \line{\qquad{}5.9 Matrices \dotfill{} 43}
  472. \line{\qquad{}5.10 Displayed equations \dotfill{} 45}
  473. \line{6.~All in a row \dotfill{} 48}
  474. \line{\qquad{}6.1 Picking up the tab \dotfill{} 48}
  475. \line{\qquad{}6.2 Horizontal alignment with more sophisticated patterns
  476.       \dotfill{} 51}
  477. \line{7.~Rolling your own \dotfill{} 55}
  478. \line{\qquad{}7.1 The long and short of it \dotfill{} 55}
  479. \line{\qquad{}7.2 Filling in with parameters \dotfill{} 57}
  480. \line{\qquad{}7.3 By any other name \dotfill{} 60}
  481. \line{8.~To err is human \dotfill{} 62}
  482. \line{\qquad{}8.1 The forgotten bye \dotfill{} 62}
  483. \line{\qquad{}8.2 The misspelled or unknown control sequence \dotfill{} 62}
  484. \line{\qquad{}8.3 The misnamed font \dotfill{} 64}
  485. \line{\qquad{}8.4 Mismatched mathematics \dotfill{} 64}
  486. \line{\qquad{}8.5 Mismatched braces \dotfill{} 65}
  487. \line{9.~Digging a little deeper \dotfill{} 68}
  488. \line{\qquad{}9.1 Big files, little files \dotfill{} 68}
  489. \line{\qquad{}9.2 Larger macro packages \dotfill{} 69}
  490. \line{\qquad{}9.3 Horizontal and vertical lines \dotfill{} 70}
  491. \line{\qquad{}9.4 Boxes within boxes \dotfill{} 72}
  492. \line{10.~Control word list \dotfill{} 77}
  493. \ifwritinganswers
  494.     \line{11.~I get by with a little help\dotfill{} 80}
  495. \fi
  496.  
  497.  
  498.  
  499. \section{Getting Started}
  500.  
  501. \subsection{What \TeX{} is and what \TeX{} isn't}
  502.  
  503. First of all, let's see what steps are necessary to produce a
  504. document using \TeX\null.  The first step is to type the file
  505. that \TeX{} reads. This is usually called the \TeX{} file or the
  506. input file, and it can be created using a simple text editor (in
  507. fact, if you're using a fancy word processor, you have to be sure
  508. that your file is saved in ASCII or nondocument mode without any
  509. special control characters). The \TeX{} program then reads your
  510. input file and produces what is called a DVI file (DVI stands for
  511. DeVice Independent). This file is not readable, at least not by
  512. humans. The DVI file is then read by another program (called a
  513. device driver) that produces the output that is readable by
  514. humans\TeXref{23}. Why the extra file? The same DVI file can be
  515. read by different device drivers to produce output on a dot
  516. matrix printer, a laser printer, a screen viewer, or a
  517. phototypesetter. Once you have produced a DVI file that gives
  518. the right output on, say, a screen viewer, you can be assured
  519. that you will get exactly the same output on a laser printer
  520. without running the \TeX{} program again.
  521.  
  522. The process may be thought of as proceeding in the following way:
  523. $$
  524. {\hbox{edit text\quad} \atop \longrightarrow}
  525. \lower .6cm \makebox{1.5cm}{1.8cm}%
  526. {\vbox{\hbox{\TeX{}}
  527.        \hbox{input}
  528.        \hbox{file}
  529.        }%
  530. }%
  531. {\hbox{\quad \TeX{} program\quad} \atop \longrightarrow}
  532. \lower .6cm \makebox{1.5cm}{1.8cm}%
  533. {\vbox{\hbox{DVI}
  534.        \hbox{file}}
  535. }%
  536. {\hbox{\quad device driver\quad} \atop \longrightarrow}
  537. \lower .6cm \makebox{1.5cm}{1.8cm}%
  538. {\vbox{\hbox{readable}
  539.        \hbox{output}}
  540. }%
  541. $$
  542.  
  543. This means that we don't see our output in its final form when it
  544. is being typed at the terminal. But in this case a little
  545. patience is amply rewarded, for a large number of symbols not
  546. available in most word processing programs become available. In
  547. addition, the typesetting is done with more precision, and the
  548. input files are easily sent between different computers by
  549. electronic mail or on a magnetic medium.
  550.  
  551. Our focus will be on the first step, that is, creating the \TeX{}
  552. input file and then running the \TeX{} program to produce
  553. appropriate results.  There are two ways of running the \TeX{}
  554. program; it can be run in batch mode or interactively.  In
  555. batch mode you submit your \TeX{} input file to your computer;
  556. it then runs the \TeX{} program without further intervention and
  557. gives you the result when it is finished.  In interactive mode
  558. the program can stop and get further input from the user, that
  559. is, the user can interact with the program.  Using \TeX{}
  560. interactively allows some errors to be corrected by the user,
  561. while the \TeX{} program makes the corrections in batch mode as
  562. best it can. Interactive is the preferred mode, of course. All
  563. personal computer and many mainframe implementations are
  564. interactive.  On some mainframes, however, the only practical
  565. method of running \TeX{} is in batch mode.
  566.  
  567.  
  568. \subsection{From \TeX{} file to readable output, the big set up}
  569. \vskip\baselineskip
  570.  
  571. {\parskip = 0pt \noindent
  572. [Note from MD:
  573. {\sl This is the only system dependent section in the manual and
  574. may be replaced by a local guide. No reference is made to it
  575. outside of the section itself. The following local information
  576. should be included:
  577. \item{$\bullet$} What initial steps, if any, should be taken by the reader
  578. to permit the running of \TeX{} and your local device driver(s).
  579. \item{$\bullet$} How to run \TeX\null.
  580. \item{$\bullet$} How to read the log file.
  581. \item{$\bullet$} How to preview and/or print the dvi file.
  582.  
  583. The following sample is applicable here at the University of
  584. Manitoba.  We use a locally written editor (MANTES) on an
  585. Amdahl running MVS; I'm fairly certain that it's the worst possible case.}]
  586. }
  587.  
  588.  
  589. In this section we'll see how to run \TeX{} at the University of
  590. Manitoba.  It is assumed that the reader is familiar with MANTES
  591. and can create text files using it.
  592.  
  593. First, there are several things that must be done {\bf one time
  594. only}. To start you must do the following (you type in the
  595. material that looks like typewriter type):
  596. \item{(1)} allocate the files that \TeX{} will use by typing the
  597. following lines (while in MANTES):
  598. \itemitem{}  C: {\tt alloc da=source.tex format=vb,256,6144}
  599. \itemitem{}  C: {\tt alloc da=dvi format=fb,1024,6144}
  600.  
  601. \item{(2)} Create a file called RUNTEX in your MANTES aggregate
  602. containing the following JCL:
  603.  
  604. \beginuser
  605. //        JOB  ,'RUN TEX'
  606. //        EXEC TEXC
  607. //SRC     DD DSN=<userid>.SOURCE.TEX,DISP=SHR
  608. //DVI     DD DSN=<userid>.DVI,DISP=OLD
  609. \enduser
  610.  
  611.  
  612. The name {\tt <userid>} is replaced by your own user id, of
  613. course. The use of upper case and the spaces must be followed
  614. exactly.
  615.  
  616. \item{(3)} Create a file called PRINTTEX in your MANTES aggregate
  617. containing the following JCL:
  618.  
  619. \beginuser
  620. //        JOB  ,'PRINT TEX'
  621. //        EXEC TEXP
  622. //DVIFILE DD DSN=<userid>.DVI,DISP=SHR
  623. \enduser
  624.  
  625.  
  626. Once you have completed these three steps, you are ready to run a
  627. \TeX{} job. The files you have created will allow you to produce
  628. about ten pages of ordinary text.
  629.  
  630. Here are the steps you use {\bf each time you run a job}.
  631.  
  632. \item{(1)} create a MANTES file containing your \TeX{} input.
  633. \item{(2)} save and submit your file using the commands
  634. \itemitem{} C: {\tt save f/l to da=source.tex noseq}
  635. \itemitem{} C: {\tt submit runtex}
  636. \item{(3)} when you get a message saying that your job is finished,
  637. enter the command
  638. \itemitem{} C: {\tt out <jobname>; list ttyout}
  639.  
  640. In this command, {\tt <jobname>} is replaced by your user id with
  641. a dollar sign appended.  This file listing will tell you of any
  642. errors that might have occurred.  It is an abbreviated version of
  643. what is called the ``log file''; we will use the term ``log
  644. file'' to refer to the ttyout file produced by \TeX\null.
  645.  
  646. If you want, you can check on the status of your job while it is
  647. executing by using the command
  648. \itemitem{} C: {\tt q <jobname>}
  649.  
  650. When you are finished looking at the log file, the command {\tt
  651. end scratch} will throw away the log file while the command {\tt
  652. end release} will send the log file to the printer, and it can
  653. then be picked up with your \TeX{} output.
  654.  
  655. \item{(4)} when your output from RUNTEX program is error free, \TeX{}
  656. will have created a legal DVI file.  To print it, use the
  657. command
  658. \itemitem{} C: {\tt submit printtex nohold}
  659.  
  660. As in (3), you can check on the status of your job while it is
  661. executing.
  662. \item{(5)} Pick up your output at the I/O window, sixth floor
  663. Engineering building.  It usually takes about twenty minutes for the
  664. output to be ready.  Ask for it by ``{\tt <jobname>}''.
  665.  
  666. The files created are large enough for running \TeX{} jobs of about
  667. 10 pages.  A job of that size will take about one second of CPU time
  668. to run through \TeX\null.  It will take about 15 seconds of CPU time to
  669. print 10 pages on the Xerox 8600 using the current device driver.
  670.  
  671. You can print your own copy of this manual using the command
  672. {\tt \%docu tex}. You can also find lots of other useful
  673. online information about \TeX{} by using {\tt \%texinfo}.
  674.  
  675. \subsection{Let's do it!}
  676.  
  677. So, from our viewpoint, the name of the game is to create the \TeX{}
  678. file that produces the right readable output. What does
  679. a \TeX{} file look like? It consists of characters from an
  680. ordinary terminal, that is, upper and lower case letters,
  681. numbers, and the usual punctuation and accent characters (these
  682. are the usual ASCII characters). Text, for the most part, is just
  683. typed normally. Special instructions usually start with one of a
  684. few special symbols such as {\tt \#} or {\tt \&} (these will be
  685. described in more detail later). Here is an example of a \TeX{}
  686. input file:
  687.  
  688. \beginuser
  689. Here is my first \\TeX\\ sentence.
  690. \\bye
  691. \enduser
  692. \toindex{TeX{} } \toindex{ }
  693.  
  694.  
  695. First note that the characters in this example look like
  696. typewriter type. We use these characters with all examples that
  697. are meant to be typed from the computer terminal. Second, note
  698. that the backslash appears three times in the text. We'll soon
  699. see that this is one of the special symbols mentioned
  700. previously, and it is used very frequently when making \TeX{}
  701. documents. Make a file containing this example. Use the \TeX{}
  702. program to make a DVI file and a device driver to see what you
  703. have produced. If all goes well, you'll have a single page with
  704. the following single sentence:
  705.  
  706. Here is my first \TeX\ sentence.
  707.  
  708.   There will also be a page number at the bottom of the page. If
  709. you've gotten this far, congratulations! Once you can produce one
  710. \TeX{} document, it's just a matter of time before you can do
  711. more complicated ones. Now let's compare what we typed in with
  712. what we got out. The straightforward words were just typed in
  713. normally, and \TeX{} set them in ordinary type. But the word ``\TeX'',
  714. which can't be typed in on a terminal because the letters
  715. aren't on the same line, is entered by using a word starting with
  716. a backslash, and \TeX{} made the proper interpretation. Most
  717. symbols that are not ordinary letters, numbers, or punctuation
  718. are typeset by entering a word starting with a backslash. If we
  719. look a little closer, we'll note that the word ``first'' is also
  720. changed.
  721. \TeXref{4}
  722. The first two letters have been joined together and there isn't
  723. a separate dot over the letter ``i''. This is standard
  724. typesetting practice: certain letter combinations are joined up
  725. to form what are called {\sl ligatures}. There is actually a good
  726. \aesthetic{} reason for this. Compare the first two letters of
  727. ``first'' and ``{f}irst'' to see the difference. We note that
  728. {\tt \\bye} appears in the input file with no corresponding word
  729. in the final copy.
  730. \toindex{bye}
  731. This a typesetting instruction that tells \TeX{} that the input
  732. is finished. We'll learn about lots of different typesetting
  733. instructions as we go along.
  734.  
  735. Let's look at the log file that was created when we ran \TeX
  736. \null. It may vary slightly at your site, but should look
  737. something like this:
  738. \beginuser
  739.    1.
  740.    2.  This is TeX, MVS Version 2.9 (no format preloaded)
  741.    3.   ** File  PLAIN.FMT <-- DD=FMTLIB MEM=PLAIN
  742.    4.
  743.    5.   ** File  SRC.TEX <-- DD=SRC
  744.    6.  (src.tex [1]
  745.    7.  Output written on DVI (1 page, 256 bytes).
  746.    8.  Transcript written on TEXLOG.
  747. \enduser
  748.  
  749.  
  750. This is the file that will contain any error messages. On line 6,
  751. {\tt (src.tex\ } indicated that \TeX{} has started reading that
  752. file. The appearance of {\tt [1]} indicates that page 1 has been
  753. processed. If there were errors on page 1, they would be listed
  754. at that point.
  755.  
  756. \vskip .5cm
  757. \exercise Add a second sentence to your original \TeX{} file to get:
  758. \beginuser
  759. Here is my first \\TeX\\ sentence.
  760. I was the one who typeset it!
  761. \\bye
  762. \enduser
  763.  
  764. Use \TeX{} and look at your output. Is the second sentence on a
  765. new line?
  766.  
  767.  
  768. \exercise Now add this line to the beginning of your file:
  769. \beginuser
  770. \\nopagenumbers
  771. \enduser
  772. \noindent
  773. Guess what will happen when you run the new file through
  774. \TeX\null.  Now try it and see what happens.
  775. \toindex{nopagenumbers}
  776.  
  777. \exercise Add three or four more sentences to your file.
  778. Use letters, numbers, periods, commas, question marks,
  779. and exclamation points, but don't use any other symbols.
  780.  
  781.  
  782. \exercise Leave a blank line and add some more sentences.
  783. You can now get new paragraphs.
  784. \medskip
  785.  
  786. We have now seen a major principle concerning the preparation of
  787. \TeX{} input files. The placement of the text on your computer
  788. terminal does not necessarily correspond to the placement of the
  789. text on your output. You can not, for example, add space between
  790. words in your output by adding spaces in your input file. Several
  791. consecutive spaces and one space will produce exactly the same
  792. output. As would be expected, a word at the end of one line will
  793. be separated from the first word of the following line. In fact,
  794. sometimes when working on a file that will be heavily edited, it
  795. is convenient to start each sentence on a separate line. Spaces
  796. at the beginning of a line, however, are always ignored.
  797.  
  798. \exercise Add the following sentence as a new paragraph, and then
  799. typeset it:
  800. \beginuser
  801. Congratulations! You received a grade of 100\% on your latest
  802. examination.
  803. \enduser
  804. \noindent
  805. The {\tt\%} sign is used for comments in your input file.
  806. Everything on a line following this symbol is ignored. Notice
  807. that even the space that normally separates the last word on one
  808. line from the first word on the next line is lost. Now put a
  809. backslash in front of the {\tt\%} sign to correct the
  810. sentence. \toindex{\$} \toindex{\%}
  811.  
  812. \exercise Add the following sentence as a new paragraph:
  813. \beginuser
  814. You owe me \$10.00 and it's about time you sent it to me!
  815. \enduser
  816. \noindent
  817. This will produce an error in your log file (if your
  818. implementation of \TeX{} is interactive, that is, sends you
  819. messages and waits for answers, just hit the carriage return or
  820. enter key when you get the error message). You will get output,
  821. but not what you might expect. Look at the log file and see
  822. where the error messages are listed. Don't worry about the
  823. actual messages. We'll have a lot more to say about errors
  824. (including this one) later. Now fix the error by putting a
  825. backslash in front of the {\tt \$} sign, and typeset the result
  826. (there are a small number of characters like the per cent and
  827. dollar signs that \TeX{} uses for its own purposes. A table of
  828. these characters will be provided shortly).
  829.  
  830. \subsection{\TeX{} has everything under control}
  831.  
  832. We have seen that the backslash has a special role. Any word
  833. starting with a backslash will be given a special interpretation
  834. when \TeX{} reads it from your input file. Such a word is called
  835. a {\sl control sequence}. There are, in fact, two types of
  836. control sequences: a {\sl control word\/} is a backslash followed
  837. by letters only (for example, {\tt \\TeX}) and a {\sl control
  838. symbol\/} is a backslash followed by a single nonletter (for
  839. example, {\tt \\\$})\null. Since a space is a nonletter, a
  840. backslash followed by a space is a legitimate control symbol.
  841. \TeXref{7--8}
  842. When we want to emphasize that a space is present, we will use a
  843. special symbol {\tt\sp} to indicate the space, as in the control
  844. symbol {\tt\\\sp}.  This convention is used in {\bf The \TeX
  845. book} as well as in this manual.
  846.  
  847. When \TeX{} is reading your input file and comes to a backslash
  848. followed by a letter, it knows that a control word is being
  849. read. So it continues reading the name of the control word until
  850. a nonletter is read. So if your file contains
  851.  
  852. \displaytext{\tt I like \\TeX!}
  853.  
  854. \noindent
  855. the control word {\tt \\TeX} is terminated by the exclamation
  856. point. But this presents a problem if you want to have a space
  857. after a control word. If you have, for example, the sentence
  858.  
  859. \displaytext{\tt I like \\TeX and use it all the time.}
  860.  
  861. \noindent
  862. in your input file, the control word {\tt\\TeX} is terminated by
  863. the space (which is, of course, a nonletter). But then you won't
  864. have a space between the words ``\TeX{}'' and ``and''; inserting
  865. more spaces won't help, since \TeX{} doesn't distinguish between
  866. one space and several consecutive spaces. But if you put the
  867. control symbol {\tt\\\sp} after a control word, you will both
  868. terminate the control word and insert a space. It's really easy
  869. to forget to put in something like {\tt\\\sp} after a control
  870. word. I promise you that you will do it at least once while
  871. you're learning to use \TeX\null.
  872.  
  873. \exercise Make an input file that will produce the following
  874. paragraph:
  875.  
  876. I like \TeX! Once you get the hang of it, \TeX{} is really easy
  877. to use. You just have to master the \TeX nical aspects.
  878.  
  879. Most control words are named so as to give a hint of their uses.
  880. You can use {\tt \\par} to make a new paragraph, for example,
  881. instead of putting in a blank line.
  882. \toindex{par}
  883.  
  884. \subsection{What \TeX{} won't do}
  885.  
  886. \TeX{} is very good at setting type, but there are things that \TeX{}
  887. can't do well.  One is making figures.  Space can be left
  888. to insert figures, but there are no graphic procedures built into
  889. the language (at present).  Some implementations allow graphic
  890. instructions to be inserted using the {\tt \\special} control
  891. word but these are exceptional and definitely site dependent.
  892.  
  893. \TeX{} sets type in horizontal straight lines and not in
  894. straight lines at other angles. In particular, it is generally
  895. not possible to make insertions in ``landscape mode'', that is,
  896. with the text rotated by so that the baseline is parallel with
  897. the long edge of the paper, or to include text that has a curve for
  898. a baseline. Perspective type (gradually increasing or
  899. decreasing in height) is not handled well by \TeX\null.
  900.  
  901. We have seen that there is an ``edit, \TeX{}, driver'' cycle that
  902. is necessary for each different copy of output.  This is true
  903. even when the output device is a terminal.  In particular, it's
  904. not possible to type the input file and see the results on the
  905. screen immediately without going through the full cycle.  Some
  906. implementations have both text and graphics displays with
  907. reasonably quick turnaround (a few seconds for a single page); as
  908. hardware becomes less expensive and processors become faster, we
  909. may see improvement.
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916. \section{All characters great and small}
  917.  
  918. \subsection{Some characters are more special than others}
  919.  
  920. We saw in the last section that most text is entered at the
  921. terminal as sentences of ordinary words just as when typing with
  922. a typewriter. But we also saw that, in particular, the backslash
  923. could be used for at least two different purposes. It can be
  924. used for symbols (or combinations of symbols) that don't appear
  925. on the keyboard such as typing {\tt \\TeX} to get \TeX\null. It
  926. can also be used to give \TeX{} special instructions such as
  927. typing {\tt \\bye} to indicate the end of the input file. In
  928. general, a word starting with a backslash will be interpreted by
  929. \TeX{} as one requiring special attention. There are several
  930. hundred words that \TeX{} knows, and you can define more
  931. yourself, and so the backslash is very important. We'll spend a
  932. lot of time as we proceed learning some of these words;
  933. fortunately we'll only need to use a small number of them most of
  934. the time.
  935.  
  936. There are ten characters which, like the backslash, are used
  937. by \TeX{} for special purposes, and we now want to give the
  938. complete list.
  939. \TeXref{37--38}What if we want to use a sentence with one of these
  940. special characters in it? With this in mind we'll ask the following
  941. questions:
  942. \item{(1)} What are the different special characters?
  943. \item{(2)} How do we use a special character if we really want to
  944. typeset it in our text?
  945.  
  946. Here is a table of each special character, its purpose, and the
  947. method of typesetting the special character itself if you need
  948. it:
  949.  
  950.  
  951. \maketable [Characters requiring special input]
  952. \halign{
  953.    \strut \hfil#\hfil & \quad # \hfil & \quad\tt # \hfil\cr
  954.    \bf Character & \bf Purpose & \bf Input for literal output \cr
  955.    \noalign{\hrule} \noalign{\smallskip}
  956.    $\backslash$   & Special symbols and instructions & \$\\backslash\$   \cr
  957.    $\{$ & Open group                       & \$\\\lb\$    \cr
  958.    $\}$ & Close group                      & \$\\\rb\$    \cr
  959.    \%   & Comments                         & \\\%         \cr
  960.    \&   & Tabs and table alignments        & \\\&         \cr
  961.    \~{} & Unbreakable space                & \\\~{}\lb\rb \cr
  962.    \$   & Starting or ending math text     & \\\$         \cr
  963.    \^{} & Math superscripts                & \\\^{}\lb\rb \cr
  964.    \_{} & Math subscripts                  & \\\_{}\lb\rb \cr
  965.    \#   & Defining replacement symbols     & \\\#         \cr
  966.        }
  967.  
  968. \toindex{\lb}
  969. \toindex{\rb}
  970. \toindex{\%}
  971. \toindex{\&}
  972. \toindex{\~{}}
  973. \toindex{\$}
  974. \toindex{\^{}}
  975. \toindex{\_{}}
  976. \toindex{\#}
  977.  
  978. \subsection{Typesetting with an accent}
  979.  
  980. Now we're going to start using some of \TeX{}'s goodies! So far
  981. we've just been using \TeX{} to make our output look attractive,
  982. but now we'll start to do things that are difficult or impossible
  983. on the typewriter. In particular, we're going to look at accents
  984. now. How do you produce an accent when the symbol doesn't appear on
  985. the keyboard? Just as with the symbol \TeX{}, it is necessary to
  986. enter a word starting with a backslash. For the word ``premi\`ere'',
  987. as a first example, you need to type in {\tt premi\\`ere}
  988. (you may have to hunt around to find the ``back prime''
  989. or ``grave'' symbol {\tt `} on your keyboard, but it's there
  990. somewhere\fnote{If you have a very old or obscure
  991. keyboard and the back prime is {\it really\/} not there, you can
  992. use {\tt \\lq\lb\rb} instead.  Similarly {\tt \\rq\lb\rb} can be
  993. used for the symbol {\tt '}. You can think of the symbols as
  994. being abbreviations for ``left quote'' and ``right quote.'' In
  995. addition, {\tt \\lq\\lq\lb\rb} and {\tt \\rq\\rq\lb\rb} give the
  996. usual quotation marks. But this won't work as a method to produce
  997. an accent over the following letter, so you're really better off
  998. with a proper keyboard.}). In general, to put an accent
  999. on a letter, the appropriate control sequence precedes the letter.
  1000.  
  1001. Here are some examples:
  1002. $$\vbox{
  1003.  
  1004. \halign{
  1005. \strut \hfil\tt # & \quad # \hfil\cr
  1006. \bf \TeX{} input & \bf \TeX{} output \cr
  1007. \noalign{\hrule} \noalign{\smallskip}
  1008. \\`a la mode          & \`a la mode \cr
  1009. r\\'esum\\'e          & r\'esum\'e  \cr
  1010. soup\\c{\sp}con   & soup\c con  \cr
  1011. No\\"el               & No\"el      \cr
  1012. na\\"\\i{\sp}ve    & na\"\i ve   \cr
  1013. }
  1014. }$$
  1015.  
  1016.  
  1017. We see several principles illustrated by these examples. Most
  1018. accents are produced by using a control symbol with a similar
  1019. shape. A few of them are produced by control words containing a
  1020. single letter. Some care must be used in this case, for a space
  1021. must be used to terminate the control word. If you have {\tt
  1022. soup\\ccon} in your file, for example, \TeX{} will look for the
  1023. control word {\tt\\ccon}\fnote{We'll see that there is another
  1024. method when we look at the grouping concept in Section~4.}.
  1025. \TeXref{52--53}
  1026.  
  1027. Notice that there is a control word {\tt\\i} also. This produces
  1028. the letter ``i'' without the dot over it; this allows an accent
  1029. to be put over the lower part of the letter. There is an
  1030. analogous control word {\tt\\j} that produces a dotless ``j''
  1031. for accenting purposes.
  1032.  
  1033. \maketable [Accents that may be immediately followed by a letter]
  1034. \halign{
  1035.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1036.    \bf Name & \bf \TeX{} input & \bf \TeX{} output \cr
  1037.    \noalign{\hrule} \noalign{\smallskip}
  1038.    grave           & \\`o & \`o \cr
  1039.    acute           & \\'o & \'o \cr
  1040.    circumflex      & \\\^{}o & \^o \cr
  1041.    umlaut/dieresis/tr\'emat & \\"{}o    & \"o \cr
  1042.    tilde           & \\\~{}o & \~o \cr
  1043.    macron          & \\={}o    & \=o \cr
  1044.    dot             & \\\char'056{}o    & \.o \cr
  1045.        }
  1046.  
  1047. \toindex{`}
  1048. \toindex{'}
  1049. \toindex{\^{}}
  1050. \toindex{"}
  1051. \toindex{i}
  1052. \toindex{j}
  1053. \toindex{=}
  1054. \toindex{.}
  1055.  
  1056. \maketable [Accents requiring an intervening space]
  1057. \halign{
  1058.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1059.    \bf Name & \bf \TeX{} input & \bf \TeX{} output \cr
  1060.    \noalign{\hrule} \noalign{\smallskip}
  1061.    cedilla         & \\c o   & \c{o} \cr
  1062.    underdot        & \\d o   & \d{o} \cr
  1063.    underbar        & \\b o   & \b{o} \cr
  1064.    h\'a\v{c}ek     & \\v o   & \v{o} \cr
  1065.    breve           & \\u o   & \u{o} \cr
  1066.    tie             & \\t oo  & \t oo \cr
  1067.    Hungarian umlaut& \\H o   & \H{o} \cr
  1068.       }
  1069.  
  1070. \toindex{c}
  1071. \toindex{d}
  1072. \toindex{b}
  1073. \toindex{v}
  1074. \toindex{u}
  1075. \toindex{t}
  1076. \toindex{H}
  1077.  
  1078. \TeX{} also allows some letters from languages other than English to
  1079. be typeset.
  1080.  
  1081. \maketable [A\kern-1pt vailable foreign language symbols]
  1082. \halign{
  1083.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1084.    \bf Example& \bf \TeX{} input & \bf \TeX{} output \cr
  1085.    \noalign{\hrule} \noalign{\smallskip}
  1086.    \AE gean, \ae sthetics     & \\AE, \\ae    & \AE, \ae \cr
  1087.    \OE uvres, hors d'\oe uvre & \\OE \\oe     & \OE, \oe \cr
  1088.    \AA ngstrom                & \\AA, \\aa    & \AA, \aa \cr
  1089.    \O re, K\o benhavn         & \\O, \\o      & \O, \o   \cr
  1090.    \L odz, \l\'odka           & \\L, \\l      & \L, \l   \cr
  1091.    Nu\ss                      & \\ss          & \ss      \cr
  1092.    ?`Si?                      & {?}{`}        & ?`       \cr
  1093.    !`Si!                      & {!}{`}        & !`       \cr
  1094.    Se\~nor                    & \\\~{}        & \~{}       \cr
  1095.                              & \lb\\it\\\$\rb & {\it\$}  \cr
  1096.       }
  1097.  
  1098. \toindex{AE}
  1099. \toindex{ae}
  1100. \toindex{OE}
  1101. \toindex{oe}
  1102. \toindex{AA}
  1103. \toindex{aa}
  1104. \toindex{O}
  1105. \toindex{o}
  1106. \toindex{L}
  1107. \toindex{l}
  1108. \toindex{ss}
  1109.  
  1110. Typeset the sentence in each of the following exercises:
  1111.  
  1112. \exercise Does \AE schylus understand \OE dipus?
  1113.  
  1114. \exercise The smallest internal unit of \TeX{} is about 53.63\AA.
  1115.  
  1116. \exercise They took some honey and plenty of money wrapped up in a
  1117. {\it \$}5 note.
  1118.  
  1119. \exercise \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  1120.  
  1121. \exercise Za\v sto tako polako pijete \v caj?
  1122.  
  1123. \exercise Mein Tee ist hei\ss.
  1124.  
  1125. \exercise Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  1126.  
  1127. \exercise ?`Por qu\'e no bebes vino blanco? !`Porque est\'a avinagrado!
  1128.  
  1129. \exercise M\'\i\'\j n idee\"en worden niet be\"\i nvloed.
  1130.  
  1131. \exercise Can you take a ferry from \"Oland to \AA land?
  1132.  
  1133. \exercise T\"urk\c ce konu\c san ye\u genler nasillar?
  1134.  
  1135.  
  1136. \def\bdots{$\textfont0=\tenbf \ldots$} %%% boldface version of \ldots
  1137.  
  1138. \subsection{Dots, dashes, quotes, \bdots}
  1139.  
  1140. Typing has always been a compromise: the small number of keys
  1141. (compared to the number of typeset symbols available) has forced
  1142. some changes on the typist.  When preparing material using \TeX{},
  1143. there is no need to be so restricted. In this section we'll look
  1144. at some differences between typing and using \TeX\null.
  1145.  
  1146. There are four types of dashes that are used.  The hyphen is used
  1147. for combining words into one unit as with mother-in-law.
  1148. \TeXref{3--5}
  1149. The en-dash is used to indicate a sequence of page numbers, years
  1150. or such things. The em-dash is a grammatical symbol.  The minus
  1151. sign is used for negative numbers. Here they are with their uses:
  1152.  
  1153. \maketable [Different types of dashes]
  1154. \halign{
  1155.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil
  1156.                         & \hfil # \hfil\cr
  1157.    \bf Name& \bf \TeX{} input & \bf \TeX{} output & \bf Example\cr
  1158.    \noalign{\hrule} \noalign{\smallskip}
  1159.    hyphen     & -         & -   & The space is 3-dimensional. \cr
  1160.    en-dash    & {-}{-}    & --  & Read pages 3--4. \cr
  1161.    em-dash    & {-}{-}{-} & --- & I saw them---there were 3 men alive. \cr
  1162.    minus sign & \$-\$     & $-$ & The temperature dropped to $-$3 degrees. \cr
  1163.       }
  1164.  
  1165. \exercise I entered the room and---horrors---I saw both my
  1166. father-in-law and my mother-in-law.
  1167.  
  1168. \exercise The winter of 1484--1485 was one of discontent.
  1169. \bigskip
  1170.  
  1171.  
  1172. Another difference between typing and using \TeX{} is the use of
  1173. quotation marks.  Opening and closing quotation marks are the
  1174. same on a typewriter.  They are produced in \TeX{} by using the
  1175. apostrophe or prime key {\tt '} and backprime key {\tt `}\null.
  1176. An open quote is produced by {\tt ``} and the
  1177. close quote by {\tt ''}\null.\TeXref{3} Similarly the
  1178. opening single quote is produced by {\tt `} and the closing
  1179. single quote by {\tt '}\null. Notice that there is no need
  1180. to use the usual typing quotation mark (it normally gives a close
  1181. quote, but don't count on it).
  1182.  
  1183. \exercise His ``thoughtfulness'' was impressive.
  1184.  
  1185. \exercise Frank wondered, ``Is this a girl that can't say `No!'?''
  1186. \bigskip
  1187.  
  1188. Sometimes ellipses (three dots) are used to indicate a passage
  1189. of time or missing material.  Typing three periods will give
  1190. three dots very close together. The dots with proper spacing will
  1191. be produced by having {\tt \\dots} in your input file.
  1192. \TeXref{173}
  1193. \toindex{dots}
  1194.  
  1195. \exercise He thought, ``\dots and this goes on forever, perhaps to the
  1196. last recorded syllable.''
  1197.  
  1198. Another problem with dots is that the period after an
  1199. abbreviation normally has less space after it than does the
  1200. period at the end of a sentence. There are two ways to solve this
  1201. problem: the dot can be followed by either {\tt\\\sp} or {\tt\~{}}
  1202. to change the spacing.
  1203. \TeXref{91--92}
  1204. The second alternative will give an unbreakable space; when such
  1205. a space is between two words, these words must typeset on the
  1206. same line. The input {\tt Prof.\~{}Knuth} would cause those two
  1207. words to be typeset on one line.  This is desirable for names
  1208. like Vancouver, B.~C. and Mr.~Jones so that ``Mr.'' and ``Jones''
  1209. do not end up on separate lines. Notice that no backslash is used
  1210. with the unbreakable space.
  1211.  
  1212. \exercise Have you seen Ms.~Jones?
  1213.  
  1214. \exercise Prof.~Smith and Dr.~Gold flew from
  1215. \ifcanspell
  1216. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  1217. \else
  1218. L.~A. to Washington, D.~C., via Fargo, N.~D.
  1219. \fi
  1220.  
  1221.  
  1222. \subsection{Different fonts}
  1223.  
  1224. The most obvious difference between typewritten text and \TeX{}
  1225. output is undoubtedly the different fonts or types of symbols
  1226. used. When \TeX{} starts up it has sixteen fonts available.  Some
  1227. of these are used for technical purposes, but even so there are
  1228. several different typefaces available as can be seen in the
  1229. following table. A complete list of the sixteen fonts is given in
  1230. Appendix F of {\bf The \TeX{}book}.
  1231. \TeXref{427--432}
  1232. Most of them are used automatically; a mathematical subscript,
  1233. for example, is put in smaller type by \TeX{} with no special
  1234. user intervention.
  1235.  
  1236. To change from the usual (roman) typeface to italic, the control
  1237. word {\tt \\it} is used.  To change back to the usual roman
  1238. typeface, use {\tt \\rm}. For example, you could have the
  1239. following sentence: {\tt I started with roman type, \\it switched
  1240. to italic type, \\rm and returned to roman type}. This would give
  1241. the following: I started with roman type, \it switched to italic
  1242. type,\fnote{Notice that the comma and this footnote are in
  1243. italic type, and this looks a little funny. We'll see that there
  1244. is another method for changing fonts when we talk about grouping
  1245. in Section 4.}
  1246. \rm and returned to roman type.
  1247.  
  1248. Typefaces other than italic are also available. Those given below
  1249. are the ones most commonly used.  They are available immediately
  1250. when \TeX{} starts. A little later we'll see how to use other
  1251. typefaces that aren't available when \TeX{} starts.
  1252.  
  1253. \global\advance\footnotenum by 1
  1254. \maketable [Font Samples]
  1255. \halign{
  1256.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1257.    \bf Font name & \bf \TeX{} switch sequence & \bf Sample of typeface \cr
  1258.    \noalign{\hrule} \noalign{\smallskip}
  1259.    Roman       & \\rm  & \rm This is roman type. \cr
  1260.    Boldface    & \\bf  & \bf This is boldface type. \cr
  1261.    Italic      & \\it  & \it This is italic type. \cr
  1262.    Slanted     & \\sl  & \sl This is slanted type. \cr
  1263.    Typewriter  & \\tt  & \tt This is typewriter type. \cr
  1264.    Math symbol${}^\the\footnotenum$ & \\cal & $\cal SOME\hbox{\quad}SCRIPT
  1265.                                      \hbox{\quad}LETTERS$\rm. \cr
  1266.       }
  1267.  
  1268. \footnote{}{\llap{$^\the\footnotenum$}%
  1269. This example is cheating since you need to know a little about
  1270. mathematics input to use it, but I wanted to include it anyway.
  1271. You'll be able to use these letters after you study the use of
  1272. mathematical symbols.}
  1273. \nobreak
  1274. \toindex{it}
  1275. \toindex{rm}
  1276. \toindex{bf}
  1277. \toindex{sl}
  1278. \toindex{tt}
  1279.  
  1280. The slanted and italic fonts seem quite similar at first.  It is
  1281. easy to see the difference between the letter ``a'' in each
  1282. sample. When changing from a slanted or italic font to a roman
  1283. font, the last letter in the first font will lean towards the
  1284. first letter of the roman font; this looks cramped, and to
  1285. compensate there is a little extra space that can be added called
  1286. the {\sl italic correction}. This is done using the control
  1287. symbol {\tt \\/}.
  1288. \toindex{/}
  1289. In the following sentence, there is no italic correction after
  1290. the first sequence of italic letters but there is after the
  1291. second sequence; see the difference: {\it If} the italic
  1292. correction is not used the letters are too close together, but
  1293. {\it if\/} the correction is used, the spacing is better.  There
  1294. is no need for the italic correction when the italic characters
  1295. are followed by a comma or a period, but your text will
  1296. definitely look better if you use it before quotation marks or
  1297. parentheses.
  1298.  
  1299.  
  1300. It is possible to use fonts other than those initially defined in
  1301. \TeX{} when desired (assuming that they are available on
  1302. your computer system, of course).  Different sizes can be used
  1303. with the aid of the control word {\tt \\magstep}. To define your
  1304. new font you will have to know its name on your computer system.
  1305. For example, the roman typeface is called ``cmr10'' on most
  1306. systems.  If you use {\tt \\font\\bigrm = cmr10 scaled \\magstep
  1307. 1}, you can then use {\tt\\bigrm} in exactly the same way as you
  1308. use {\tt\\it} or {\tt\\rm}.
  1309. \TeXref{13--17}
  1310. \toindex{magstep}
  1311. \toindex{font}
  1312. \toindex{scaled}
  1313.  
  1314. Switching via {\tt\\bigrm} will give roman type that is larger
  1315. than the usual by 20\%\null.  {\tt \\font\\bigbigrm = cmr10
  1316. scaled \\magstep 2} will define a font that is about 44\% larger
  1317. than the usual roman typeface.  The sizes {\tt \\magstep~0} to
  1318. {\tt \\magstep~5} are available.  On most computers {\tt \\magstephalf}
  1319. is also available; this represents an enlargement of
  1320. about 9.5\%\null. Here are some samples at various sizes:
  1321.  
  1322. \maketable [Different Font Magnifications]
  1323. \halign{
  1324.    \strut \tt # \hfil & \quad # \hfil \cr
  1325.    \bf Magnification & \bf Sample \cr
  1326.    \noalign{\hrule} \noalign{\smallskip}
  1327.    \\magstep 0     & \rm  Sample text at magstep 0. \cr
  1328.    \\magstephalf   & \halfrm  Sample text at magstephalf. \cr
  1329.    \\magstep 1     & \brm  Sample text at magstep 1. \cr
  1330.    \\magstep 2     & \bbrm  Sample text at magstep 2. \cr
  1331.    \\magstep 3     & \bbbrm  Sample text at magstep 3. \cr
  1332.    \\magstep 4     & \bbbbrm  Sample text at magstep 4. \cr
  1333.    \\magstep 5     & \bbbbbrm  Sample text at magstep 5. \cr
  1334.       }
  1335. \bigskip
  1336.  
  1337. It's also possible to use completely new typefaces.  These
  1338. are dependent on system availability, of course.  Many systems
  1339. have a file called CMSS10 which is a font that contains sans
  1340. serif letters.  Using {\tt \\font\\sf = cmss10} will allow the
  1341. control word {\tt\\sf} to be used in the same manner as {\tt\\bf}.
  1342. Having made this definition, the input
  1343. \displaytext{\tt \\sf Here is a sample of our new Sans Serif font.}
  1344. will produce
  1345. \displaytext{\sf Here is a sample of our new Sans Serif font.}
  1346.  
  1347. \exercise What problem might have arisen if we had used {\tt \\ss}
  1348. instead of {\tt \\sf} to turn on the Sans Serif font? Hint: if
  1349. the answer doesn't occur to you at first, think about the German
  1350. alphabet and it will finally come to you.
  1351.  
  1352. \exercise Typeset a paragraph of magnified sans serif text.
  1353.  
  1354. The extra fonts available may vary from site to site.  The ones
  1355. in the following table are available at most places.
  1356.  
  1357. \maketable [External Fonts Names]
  1358. \halign{
  1359. \strut \tt # \hfil & \quad \tt # \hfil & \quad \tt # \hfil
  1360.                    & \quad \tt # \hfil & \quad \tt # \hfil
  1361.                    & \quad \tt # \hfil  \cr
  1362. \noalign{\hrule} \noalign{\smallskip}
  1363. CMBSY10   &CMBXSL10  &CMBXTI10  &CMBX10    &CMBX12    &CMBX5      \cr
  1364. CMBX6     &CMBX7     &CMBX8     &CMBX9     &CMB10     &CMCSC10    \cr
  1365. CMDUNH10  &CMEX10    &CMFF10    &CMFIB8    &CMFI10    &CMITT10    \cr
  1366. CMMIB10   &CMMI10    &CMMI12    &CMMI5     &CMMI6     &CMMI7      \cr
  1367. CMMI8     &CMMI9     &CMR10     &CMR12     &CMR17     &CMR5       \cr
  1368. CMR6      &CMR7      &CMR8      &CMR9      &CMSLTT10  &CMSL10     \cr
  1369. CMSL12    &CMSL8     &CMSL9     &CMSSBX10  &CMSSDC10  &CMSSI10    \cr
  1370. CMSSI12   &CMSSI17   &CMSSI8    &CMSSI9    &CMSSQI8   &CMSSQ8     \cr
  1371. CMSS10    &CMSS12    &CMSS17    &CMSS8     &CMSS9     &CMSY10     \cr
  1372. CMSY5     &CMSY6     &CMSY7     &CMSY8     &CMSY9     &CMTCSC10   \cr
  1373. CMTEX10   &CMTEX8    &CMTEX9    &CMTI10    &CMTI12    &CMTI7      \cr
  1374. CMTI8     &CMTI9     &CMTT10    &CMTT12    &CMTT8     &CMTT9      \cr
  1375. CMU10     &CMVTT10                                                \cr
  1376. }
  1377. \bigskip
  1378.  
  1379. Here's a little background about these names.  The first two
  1380. letters {\tt CM} stands for Computer Modern, the name given to
  1381. this font family by the designer. The number at the end is the
  1382. point size: 10 point type is the normal size, 7 point is the
  1383. normal size for subscripts, and 5 point is the normal size for
  1384. subscripts of subscripts, 12 point is 20\% larger than 10 point,
  1385. etc. If the letters {\tt CM} are followed by {\tt B}, it is a
  1386. boldface type.  Similarly {\tt R} indicates roman, {\tt I} is for
  1387. italics, {\tt CSC} is for small caps, {\tt SL} is for slanted,
  1388. {\tt SS} is for sans serif, {\tt SY} is for symbols,
  1389. and {\tt TT} is for typewriter type.
  1390.  
  1391. \exercise Find the fonts available on your system, and print out
  1392. all the letters and numbers in several of them.
  1393.  
  1394. \exercise The font {\tt CMR12} is 20\% larger than {\tt CMR10}.
  1395. Also {\tt \\magstep~1} magnifies the type by 20\%.  Take some
  1396. text and print it using {\tt CMR12} then using {\tt CMR10} scaled
  1397. by {\tt \\magstep~1}. The results are quite different!
  1398.  
  1399.  
  1400.  
  1401.  
  1402. \section{The shape of things to come}
  1403.  
  1404. In this section we want to see how to make text have different
  1405. shapes or sizes.  One may use \TeX{} with the default sizes, of
  1406. course, just as we have been doing so far.  We'll now become more
  1407. creative with our output.  In discussing the size of various
  1408. parts of a page of text, there are several units of measure we
  1409. can use.
  1410.  
  1411. \subsection{Units, units, units}
  1412.  
  1413. \TeX{} can measure length using many types of units.  The most
  1414. common are the inch, the \centimeter, the point, the pica. The
  1415. abbreviations for these units are {\tt in}, {\tt cm}, {\tt pt},
  1416. and {\tt pc} respectively. The point is defined by the equation 1
  1417. inch = 72.27 points, and the pica by 1 pica = 12 points. Thus a
  1418. point is rather small and is about the size of a decimal point.
  1419. Here is a sample to give an idea of the comparative sizes:
  1420. \def\pip{\vrule height 4 true pt }
  1421. \TeXref{57}
  1422.  
  1423. $$ \hbox{1 inch: } \hbox to 1 true in{\pip\hrulefill\pip}$$
  1424. $$ \hbox{1 \centimeter: }\hbox to 1 true cm{\pip\hrulefill\pip}$$
  1425. $$ \hbox{20 points: }\hbox to 20 true pt{\pip\hrulefill\pip}$$
  1426. $$ \hbox{1 pica: } \hbox to 1 true pc{\pip\hrulefill\pip}$$
  1427.  
  1428. Thus points are used to make fine changes; a pica is about the
  1429. distance between the baselines of two consecutive lines of
  1430. (unmagnified) normal text.  \TeX{} is quite exact about
  1431. dimensions; internally its smallest unit is less than one
  1432. four-millionth of an inch.  Hence it is the resolution of the
  1433. output device that will determine the accuracy of the output.
  1434.  
  1435. There are two other units that are sometimes useful that have
  1436. different sizes in different fonts. The {\tt ex} is about the
  1437. height of a small ``x'' and the {\tt em} is a little smaller than
  1438. the width of a capital ``M''\null.
  1439. \TeXref{60}
  1440.  
  1441. The shape of the output is generally determined by control
  1442. words. There are many such words; these allow very fine control
  1443. of the resulting text.  But most of the time only a small number
  1444. of them are necessary.
  1445.  
  1446. \subsection{Page shape}
  1447.  
  1448. The text on a page consists of three basic parts.  There is the
  1449. headline above the main text; this often contains a chapter
  1450. title, section title, or a page number, and may differ on odd and
  1451. even pages. Below this is the main text, which includes any
  1452. footnotes. And finally there is the footline that might contain a
  1453. page number.
  1454.  
  1455. In the examples we have seen so far, the headline has been blank.
  1456. The footline has contained either a \centred{} number or, if {\tt
  1457. \\nopagenumbers} had been used, has also been blank.  We'll have
  1458. more to say about headlines and footlines later in this section.
  1459. For the moment let's concentrate on the main text.
  1460.  
  1461. To finish one page and start a new one, {\tt \\vfill \\eject} can
  1462. be used.  The control word {\tt \\eject} forces the completion of
  1463. the current page, while {\tt \\vfill} causes any left over
  1464. vertical space to be gathered at the bottom of the page (you might
  1465. try leaving out the {\tt \\vfill} as an experiment to see how the
  1466. vertical \analog{} of justified horizontal lines of text works).
  1467. \toindex{vfill}
  1468. \toindex{eject}
  1469.  
  1470.  
  1471. {\hsize=4in
  1472. The current horizontal width of the text on the page is described
  1473. by the control word {\tt \\hsize}.  It can be changed, say to 4
  1474. inches, by {\tt \\hsize = 4 in\ } at any desired time using
  1475. methods to be described in the next few sections. The value of
  1476. {\tt \\hsize} in effect when the paragraph is completed
  1477. determines the width of the paragraph. As can be seen in this
  1478. paragraph, the text width can be changed (in this case to 4
  1479. inches) for a single paragraph.  Because it represents the
  1480. current value of the horizontal width, expressions such as {\tt
  1481.  \\hsize = 0.75\\hsize} can make a new value that is relative
  1482. to the old one. \par}
  1483. \toindex{hsize}
  1484.  
  1485. The vertical \analog{} of {\tt \\hsize} is {\tt \\vsize}, which
  1486. is the current height of the main text.  It can be reset, just
  1487. like {\tt \\hsize}.  Thus, {\tt \\vsize = 8 in\ } can be used to
  1488. change the vertical height of the main text. Note that {\tt \\vsize}
  1489. is the size of the text exclusive of any headline or
  1490. footline material.
  1491. \toindex{vsize}
  1492.  
  1493. Text can also be shifted across the page.  The upper left corner
  1494. of the text is one inch down and one inch in from the upper left
  1495. corner of the page.  The control words {\tt \\hoffset} and {\tt \\voffset}
  1496. are used to shift the text horizontally and
  1497. vertically.  Thus {\tt \\hoffset = .75 in} and {\tt \\voffset =
  1498. -.5 in} would shift the text an additional .75 inches to the
  1499. right and .5 inches up. Most of the time you'll need to set {\tt
  1500. \\hoffset}, {\tt \\voffset}, and {\tt \\vsize} at the beginning
  1501. of your document only.
  1502. \TeXref{251}
  1503. \toindex{hoffset}
  1504. \toindex{voffset}
  1505.  
  1506. \global\advance\footnotenum by 1
  1507. \maketable [Control words for page sizes]
  1508. \halign{
  1509.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1510.    \bf Name & \bf \TeX{} Control Word & \bf \TeX{} default value (inches)\cr
  1511.    \noalign{\hrule} \noalign{\smallskip}
  1512.    horizontal width  & \\hsize   & 6.5 \cr
  1513.    vertical width    & \\vsize   & 8.9 \cr
  1514.    horizontal offset${}^\the\footnotenum$  & \\hoffset & 0 \cr
  1515.    vertical offset${}^\the\footnotenum$   & \\voffset & 0 \cr
  1516.       }
  1517.  
  1518. \footnote{}{\llap{$^\the\footnotenum$}The text is initially 1 inch
  1519. down and 1 inch in from upper left corner of the page.}
  1520. \nobreak
  1521.  
  1522. \exercise Enter a paragraph of text that is a few lines long.
  1523. Take several copies of your paragraph and put {\tt \\hsize = 5
  1524. in\ } before one and {\tt \\hsize = 10 cm\ } in front of a second
  1525. one.  Try a few other values for {\tt \\hsize}.
  1526.  
  1527. \exercise Put {\tt \\hoffset = .5 in\ } and {\tt \\voffset = 1
  1528. in\ } before the first paragraph of your previous exercise.
  1529.  
  1530. \exercise Take your previous exercise and put {\tt \\vsize = 2
  1531. in\ } before the first paragraph.
  1532. \bigskip
  1533.  
  1534. In the previous section we saw that it is possible to use fonts
  1535. of larger size by using the {\tt \\magstep} control word.  It's
  1536. also possible to magnify the entire document at once. If {\tt
  1537. \\magnification = \\magstep 1} appears at the top of your document,
  1538. then all of your output is magnified by 20\%\null.  The other
  1539. values of {\tt \\magstep} can be used, too. {\bf It should be
  1540. emphasized that {\tt \\magnification} can only be used before
  1541. even a single character is typeset.}  This magnification creates
  1542. a problem in units; if the document is to be magnified by 20\%
  1543. and {\tt \\hsize = 5 in} appears in the \TeX{} input file, should
  1544. the final output have an {\tt \\hsize} of 5 inches or should it
  1545. be magnified by 20\% to 6 inches? Unless told otherwise, all the
  1546. dimensions will be magnified so that, in this case, {\tt \\hsize}
  1547. would be 6 inches in the final output.  This means that all the
  1548. dimensions will increase uniformly when {\tt \\magnification} is
  1549. used.  But for some special situations it might not be desirable
  1550. for this to happen; for example, you might want to leave a space
  1551. of exactly 3 inches to insert a figure.  In this case any unit
  1552. can be modified by {\tt true} so that {\tt \\hsize = 5 true in}
  1553. will always set the line width to 5 inches, regardless of
  1554. magnification. \TeXref{59--60} \toindex{magnification}
  1555.  
  1556. \exercise Put {\tt \\magnification = \\magstep 1} as the first
  1557. line in one of your input files and see how the output changes.
  1558.  
  1559. \subsection{Paragraph shape}
  1560.  
  1561. When \TeX{} is reading the text to be typeset from your input
  1562. file, it reads in a paragraph at a time and then typesets it.
  1563. This means that there is a lot of control over paragraph shapes,
  1564. but also that some care must be taken.  We've already seen that
  1565. {\tt \\hsize} can be used to control the width of a single
  1566. paragraph.  But suppose the following appeared as part of your
  1567. input file:
  1568.  
  1569. \beginuser
  1570. \\hsize = 5 in
  1571. Four score and seven years $\ldots$
  1572. $\vdots$
  1573. $\ldots$ from this earth.
  1574. \\hsize = 6.5 in
  1575.  
  1576. \enduser
  1577.  
  1578. What is the width of the paragraph?  The {\tt \\hsize} was
  1579. changed at the start of the paragraph and again at the end.
  1580. Since the paragraph was not completed (by putting in a blank line
  1581. or {\tt \\par}) until after the second change, the paragraph
  1582. would be typeset with a width of 6.5 inches. However, if a blank
  1583. line were inserted before {\tt \\hsize = 6.5 in}, then the
  1584. paragraph would be typeset with a width of 5 inches.  So, in
  1585. general, when a paragraph is set, the values of the parameters
  1586. that are in effect when the paragraph is completed are the ones
  1587. that are used.
  1588.  
  1589. Here is a table with some paragraph parameters:
  1590.  
  1591. \maketable [Some paragraph shape parameters]
  1592. \halign{
  1593.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1594.    \bf Function & \bf \TeX{} Control Word & \bf \TeX{} default\cr
  1595.    \noalign{\hrule} \noalign{\smallskip}
  1596.    width & \\hsize & 6.5 inches \cr
  1597.    indentation on first line & \\parindent & 20 points\cr
  1598.    distance between lines   & \\baselineskip & 12 points\cr
  1599.    distance between paragraphs & \\parskip & 0 points \cr
  1600.       }
  1601.  
  1602. \toindex{parindent}
  1603. \toindex{parskip}
  1604. \toindex{baselineskip}
  1605.  
  1606. The control word {\tt \\noindent} may be used at the beginning of
  1607. a paragraph to avoid the automatic indentation on the first line.
  1608. This control word will only affect the paragraph being set when
  1609. it is invoked (of course {\tt \\parindent = 0 pt} will cause no
  1610. indentation for all paragraphs).
  1611. \toindex{noindent}
  1612.  
  1613. {\narrower
  1614. A more flexible way to control the width of a paragraph is to use
  1615. {\tt \\rightskip} and {\tt \\leftskip}.  Setting {\tt \\leftskip
  1616. = 20 pt} causes the left margin of the paragraph to be moved in
  1617. an extra twenty points. Negative values may be assigned to {\tt
  1618. \\leftskip} to move the left margin out. The control word {\tt
  1619. \\rightskip} does the same to the right side of the paragraph.
  1620. The single control word {\tt \\narrower} is the equivalent of
  1621. setting both {\tt \\leftskip} and {\tt \\rightskip} equal to {\tt
  1622. \\parindent}.  This is quite useful for long quotations, and
  1623. this paragraph is an example of its use. As with {\tt \\hsize},
  1624. the value of {\tt \\leftskip} and {\tt \\rightskip} in effect
  1625. when the paragraph is completed is the one which will apply to
  1626. the whole paragraph.
  1627. \TeXref{100}
  1628.  
  1629. }
  1630. \toindex{leftskip}
  1631. \toindex{rightskip}
  1632. \toindex{narrower}
  1633.  
  1634. \exercise Make two paragraphs with the following specifications:
  1635. the left margin of both paragraphs is indented by 1.5 inches,
  1636. the right margin of the first paragraph is indented by 0.75
  1637. inches, and the right margin of the second paragraph is indented
  1638. by 1.75 inches.
  1639. \bigskip
  1640.  
  1641. \def\hangparagraph{ Lines can be made with different lengths
  1642. within one paragraph by using {\tt \\hangindent} and {\tt
  1643. \\hangafter}.  The amount of the indentation is determined by value
  1644. of {\tt \\hangindent}. If {\tt \\hangindent} is positive, the
  1645. indentation is made from the left, and if it is negative it is
  1646. made from the right. The lines on which the indentation occurs is
  1647. controlled by {\tt \\hangafter}.  If {\tt \\hangafter} is
  1648. positive then it determines the number of lines at full width
  1649. before the indentation starts.  Thus if {\tt \\hangindent = 1.75
  1650. in} and {\tt \\hangafter = 6}, then the first six lines will be
  1651. at full width and the rest will be indented by 1.75 inches from
  1652. the left. On the other hand if {\tt \\hangindent = \hbox{-1.75}
  1653. in} and {\tt \\hangafter = -6}, then the first six lines will be
  1654. indented by 1.75 inches from the right and the rest will be at
  1655. full width. \TeX{} resets to the default values {\tt \\hangindent
  1656. = 0 pt} and {\tt \\hangafter = 1} after each paragraph. These
  1657. control words are useful for paragraphs with ``hanging indents''
  1658. and for flowing a paragraph around space reserved for a figure.
  1659. \TeXref{355}The control word {\tt \\hang} at the beginning of the
  1660. paragraph will cause the first line to be of full width ({\tt
  1661. \\hangafter=1}) and the rest of the paragraph to be indented by
  1662. the current value of {\tt \\parindent}. But you do have to use
  1663. {\tt \\noindent} if you want the first line to extend all the way
  1664. to the left margin.
  1665. \TeXref{102}
  1666. \par}
  1667.  
  1668. \hangafter=6 \hangindent=1.75in
  1669. \hangparagraph
  1670. \toindex{hangindent}
  1671. \toindex{hangafter}
  1672. \toindex{hang}
  1673.  
  1674. Here is the previous paragraph repeated with {\tt \\hangafter = -6}
  1675. and {\tt \\hangindent = -1.75 in}.
  1676.  
  1677. \hangafter=-6 \hangindent=-1.75in \hangparagraph
  1678.  
  1679.  
  1680. The control word {\tt \\parshape} can be used to make paragraphs with
  1681. a greater variety of shapes.
  1682. \TeXref{101}
  1683. \toindex{parshape}
  1684.  
  1685. Another useful control word for setting paragraphs is {\tt \\item}.
  1686. It can be used to make various types of itemized lists,
  1687. and is invoked using the pattern {\tt \\item\lb$\ldots$\rb}\null.
  1688. This causes the next  paragraph to be formed with every line
  1689. indented by {\tt \\parindent} and, in addition, the first line
  1690. labeled on the left by whatever is between the braces.  It is
  1691. usually used with {\tt \\parskip = 0 pt}, since that control word
  1692. determines the vertical space between the different items. The control
  1693. word {\tt \\itemitem} is the same as {\tt \\item} except that the
  1694. indentation is twice as far, that is, twice the value of
  1695. {\tt \\parindent}.
  1696. \TeXref{102}Here is an example:
  1697. \toindex{item}
  1698. \toindex{itemitem}
  1699.  
  1700. \beginliteral
  1701. \parskip = 0pt \parindent = 30 pt
  1702. \noindent
  1703. Answer all the following questions:
  1704. \item{(1)} What is question 1?
  1705. \item{(2)} What is question 2?
  1706. \item{(3)} What is question 3?
  1707. \itemitem{(3a)} What is question 3a?
  1708. \itemitem{(3b)} What is question 3b?
  1709. @endliteral
  1710.  
  1711.  
  1712. \noindent
  1713. will produce
  1714. \vfill\eject
  1715.  
  1716. {\parskip = 0pt \parindent = 30 pt
  1717. \noindent
  1718. Answer all the following questions:
  1719. \item{(1)} What is question 1?
  1720. \item{(2)} What is question 2?
  1721. \item{(3)} What is question 3?
  1722. \itemitem{(3a)} What is question 3a?
  1723. \itemitem{(3b)} What is question 3b?
  1724.  
  1725. }
  1726.  
  1727. \exercise Make a paragraph several lines long and use it with
  1728. the {\tt \\item} control word to see the ``hanging indent.'' Now
  1729. take the same paragraph and use it with different values of {\tt
  1730. \\parindent} and {\tt \\hsize}.
  1731. \bigskip
  1732.  
  1733. Now let's see how to put space between paragraphs.  The control
  1734. word {\tt \\parskip} is used to determine how much space is
  1735. normally left between paragraphs. So if you put {\tt \\parskip =
  1736. 12 pt} at the beginning of your \TeX{} source file, there will be
  1737. 12 points between paragraphs unless other instructions are
  1738. given. The control word {\tt \\vskip} can be used to insert extra
  1739. vertical space between paragraphs.  If {\tt \\vskip 1 in} or {\tt
  1740. \\vskip 20 pt} appears between two paragraphs, then the extra
  1741. space is inserted.
  1742.  
  1743. There are a couple of peculiarities of {\tt \\vskip} that seem
  1744. quite strange at first.  If you have {\tt \\vskip 3 in} and the
  1745. skip starts two inches from the bottom of the page, the rest of
  1746. the page is skipped, but the extra one inch is {\it not\/}
  1747. skipped at the top of the next page.  In other words, {\tt \\vskip}
  1748. {\bf will not insert space across page boundaries}.  In
  1749. fact, {\tt \\vskip~1~in} will have no effect at all if it happens
  1750. to appear at the top of a page! For many types of vertical
  1751. spacing this is quite appropriate.  The space before a section
  1752. heading, for example, should not continue across page boundaries.
  1753.  
  1754. A similar phenomenon occurs at the beginning of your document.
  1755. If, for example, you want a title page with the title about half
  1756. way down the page, you can not insert the space at the top of the
  1757. page using {\tt \\vskip}.
  1758.  
  1759. But what if you really want some blank space at the top of a
  1760. page? You could start the page with {\tt\\\sp} but this in effect
  1761. typesets a one line paragraph containing a blank. So while
  1762. nothing is typeset, the extra space due to the values of {\tt
  1763. \\baselineskip} and {\tt \\parskip} will add extra space. An easier
  1764. method is to use {\tt \\vglue} instead of {\tt \\vskip} to get
  1765. the desired result.  Thus {\tt \\vglue 1 in\ }will leave one inch
  1766. of blank space at the top of the page.\TeXref{352}
  1767. \toindex{vglue}
  1768.  
  1769.  
  1770. We can note in passing that there is another more general method
  1771. to put material at the top of a page using the control words {\tt
  1772. \\topinsert} and {\tt \\endinsert}. If {\tt \\topinsert $\ldots$
  1773. \\endinsert} is used within a page, the material between
  1774. {\tt \\topinsert} and {\tt \\endinsert} will appear at the top
  1775. of the page, if possible. For example:
  1776.  
  1777. \vbox{
  1778.    \beginuser
  1779.    \\topinsert
  1780.    \\vskip 1 in
  1781.    \\centerline\lb Figure 1\rb
  1782.    \\endinsert
  1783.    \enduser
  1784. }
  1785. \noindent
  1786. is useful for inserting figures of a prescribed size.
  1787. \TeXref{115}
  1788. \toindex{topinsert}
  1789. \toindex{endinsert}
  1790.  
  1791. There are also some special control words for making small
  1792. vertical skips. They are {\tt \\smallskip}, {\tt \\medskip}, and
  1793. {\tt \\bigskip}. Here is the size of each one:
  1794.  
  1795. \def\hrl{\hrule width .5 in}
  1796.  
  1797. \centerline{{\tt \\smallskip}: \vbox{\hrl \smallskip \hrl} \quad
  1798.             {\tt \\medskip}: \vbox{\hrl \medskip \hrl} \quad
  1799.             {\tt \\bigskip}: \vbox{\hrl \bigskip \hrl}
  1800.             }
  1801. \toindex{smallskip}
  1802. \toindex{medskip}
  1803. \toindex{bigskip}
  1804.  
  1805. \subsection{Line shape}
  1806.  
  1807. For most material \TeX{} does a good job of breaking up a
  1808. paragraph into lines.  But sometimes it's necessary to add
  1809. further instructions. It's possible to force a new line by
  1810. inserting {\tt \\hfill \\break} in your input file. It's also
  1811. possible to  put some text on a line by itself using the control
  1812. word {\tt \\line\lb $\ldots$\rb}; then the material between the
  1813. braces will be restricted to one line (although the result will
  1814. be spread out over the whole line and may be horrible). The
  1815. control words {\tt \\leftline\lb $\ldots$\rb}, {\tt \\rightline\lb
  1816. $\ldots$\rb}, and {\tt \\centerline\lb $\ldots$\rb} will,
  1817. respectively, set the material between the braces on a single
  1818. line on the left margin, on the right margin, or \centred.  Thus
  1819. \toindex{hfill}
  1820. \toindex{break}
  1821. \toindex{centerline}
  1822. \toindex{leftline}
  1823. \toindex{rightline}
  1824. \toindex{line}
  1825.  
  1826.  
  1827. \beginliteral
  1828. \leftline{I'm over on the left.}
  1829. \centerline{I'm in the @centre.}
  1830. \rightline{I'm on the right.}
  1831. \line{I just seem to be spread out all over the place.}
  1832. @endliteral
  1833.  
  1834. \noindent
  1835. produces the four lines:
  1836. \vskip\baselineskip
  1837.  
  1838.  
  1839. {
  1840. \hbadness = 10000
  1841. \leftline{I'm over on the left.}
  1842. \centerline{I'm in the \center.}
  1843. \rightline{I'm on the right.}
  1844. \line{I just seem to be spread out all over the place.}
  1845.  
  1846. Other types of spacing can be obtained by using the control word {\tt
  1847. \\hfil}.  This causes all the extra space in the line to be
  1848. accumulated at the position where {\tt \\hfil} appears.
  1849. Thus if we alter our last example to
  1850. {\tt \\line\lb I just seem to be spread out \\hfil all over the place.\rb}
  1851. we will get \hfil\break
  1852. \medskip
  1853. \line{I just seem to be spread out \hfil all over the place.}
  1854. \medskip
  1855. If we have more than one {\tt \\hfil}, they will divide any extra
  1856. space among themselves equally.  Hence
  1857. {\tt \\line\lb left text \\hfil \centre{} text\\hfil right text.\rb}
  1858. will produce
  1859. \medskip
  1860. \line{left text \hfil \centre{} text \hfil right text.}
  1861. \toindex{hfil}
  1862. }
  1863.  
  1864. \exercise Typeset the following line:
  1865.  
  1866. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil
  1867. right guard \hfil right tackle \hfil right end}
  1868.  
  1869. \exercise Typeset the following line with twice as much space between
  1870. ``left'' and ``right-\centre{}'' as between ``right-\centre{}'' and
  1871. ``right'':
  1872.  
  1873. \line{left \hfil \hfil right-\centre{} \hfil right}
  1874.  
  1875. It's possible to move horizontally using {\tt \\hskip} in a
  1876. manner analogous with {\tt \\vskip}.
  1877. \toindex{hskip}
  1878.  
  1879. \exercise What happens with the following input:\hfil\break
  1880. {\tt \\line\lb\\hskip 1 in ONE \\hfil TWO \\hfil THREE\rb}
  1881. \bigskip
  1882.  
  1883. The right justification can be canceled by using the
  1884. control word {\tt \\raggedright}.
  1885. \toindex{raggedright}
  1886.  
  1887. \subsection{Footnotes}
  1888.  
  1889. The general pattern to make footnotes using \TeX{} is
  1890. {\tt \\footnote\lb$\ldots$\rb\lb$\ldots$\rb}\null.
  1891.  
  1892. The footnote mark goes in between the first set of braces.  Some
  1893. available marks are {\tt \\dag (\dag)}, {\tt \\ddag (\ddag)}, {\tt \\S
  1894. (\S)}, and {\tt \\P (\P)}\null.  The text of the footnote
  1895. goes between the second set of braces. The use of numbers as
  1896. marks is a little less straightforward. The footnote%
  1897. \footnote{${}^{21}$}{This is the footnote at the bottom of the page.}
  1898. at the bottom of the page was produced by using {\tt \\footnote\lb\$\lb
  1899. \rb\^{}\lb{21}\rb\$\rb\lb This is the footnote at the
  1900. bottom of the page.\rb}  after the word ``footnote'' in the
  1901. text. This construction is somewhat complicated; we'll see why
  1902. it's this way when we know a little more about typesetting
  1903. mathematics. But for the moment we can look at it as a way of
  1904. getting the job done. You may want to use {\tt \\rm} within the
  1905. footnote to ensure that the right font appears. Usually you will
  1906. not want a space between the text and the control word {\tt
  1907. footnote}.\TeXref{117}
  1908. \toindex{footnote}
  1909. \toindex{ddag}
  1910. \toindex{S}
  1911. \toindex{P}
  1912.  
  1913. \exercise Make up a page with a relatively long footnote spanning
  1914. several lines.
  1915.  
  1916. \exercise Make up a page with two different footnotes on it.
  1917.  
  1918. \subsection{Headlines and Footlines}
  1919.  
  1920. \headline={\hfil \tenrm Page \the\pageno} %example for this section
  1921.  
  1922. The lines for title and page numbers that go above and below the
  1923. main text are produced by using {\tt \\headline=\lb$\dots$\rb}
  1924. and {\tt \\footline=\lb$\dots$\rb}\null.
  1925. \TeXref{252--253}
  1926.  
  1927. The principle is the same as using the control word {\tt \\line\lb
  1928. $\dots$\rb} within the usual text on the page.  A helpful
  1929. control word is {\tt \\pageno} which represents the current page
  1930. number. Thus {\tt \\headline=\lb\\hfil \\tenrm Page \\the\\pageno\rb}
  1931. would cause the page number to appear in the upper
  1932. right corner preceded by the word ``Page'' (now look at the upper
  1933. right corner of this page). It is safer to explicitly name the
  1934. font that you want to use (in this case {\tt \\tenrm} to use the
  1935. 10 point roman font), since you are never guaranteed that a
  1936. particular font will be in use when the headline or footline is
  1937. set. The control word {\tt \\the} takes the internal value of the
  1938. next word if it is an appropriate control word and prints it as
  1939. text. You can also use the control word {\tt \\folio} instead of
  1940. {\tt \\the \\pageno}. The difference is that {\tt \\folio} will
  1941. give roman numerals when {\tt \\pageno} is negative.
  1942. \toindex{headline}
  1943. \toindex{footline}
  1944. \toindex{pageno}
  1945. \toindex{the}
  1946. \toindex{folio}
  1947.  
  1948. You can also assign values to {\tt \\pageno} if you want your
  1949. document to use a different sequence of page numbers from the
  1950. usual.  Roman numerals can be produced by using negative numbers;
  1951. {\tt \\pageno=-1} at the beginning of a document will cause page
  1952. numbers to be in roman numerals.
  1953. \TeXref{252}
  1954.  
  1955. Different headlines can be produced for even and odd pages in
  1956. the following manner:
  1957.  
  1958. {\tt
  1959. \\headline=\lb\\ifodd \\pageno \lb$\dots$\rb \\else \lb$\dots$\rb
  1960. \\fi\rb}
  1961.  
  1962. \noindent
  1963. where the material between the first set of braces is for the
  1964. right-hand pages and the material between the second set of
  1965. braces is for the left-hand pages.
  1966.  
  1967. \exercise Change the footline so that the page number is \centred{}
  1968. with an en-dash on either side.
  1969.  
  1970. \subsection{Overfull and underfull boxes}
  1971.  
  1972. One of the most frustrating experiences for the new \TeX{} user
  1973. is the occurrence of overfull and underfull boxes.  They are duly
  1974. noted in the log file and are also written to the screen when \TeX{}
  1975. is being run interactively.  Overfull boxes are also marked
  1976. on the output by a slug (a large filled-in black rectangle that
  1977. looks like this: \vrule width \overfullrule) in the right
  1978. margin. Various obscene terms are applied to this slug.  It
  1979. appears even though there is nothing wrong with the \TeX{} input.
  1980. So why is the slug there and what can be done about it?
  1981.  
  1982. A good way to visualize the way \TeX{} organizes a page is to
  1983. think of the printed material as being put into boxes. There are
  1984. two types of boxes: {\sl hboxes\/} and {\sl vboxes}.  Most of the
  1985. time these correspond to the organization of horizontal text
  1986. into lines and vertical paragraphs into pages.  In particular, it
  1987. is the spacing of the words in a hbox corresponding to a line of
  1988. text that causes the slug to appear.
  1989.  
  1990. Recall that \TeX{} reads in the complete paragraph before
  1991. deciding how to break it up into lines.  This is better than
  1992. working a line at a time, since a slight improvement in one line
  1993. might cause catastrophic changes farther down in the paragraph.
  1994. When words are gathered together to form a line, space is added
  1995. between the words to justify the right margin. Very large spaces
  1996. between words is obviously undesirable; the badness of the line
  1997. is a measure of how badly the words are spaced.  An underfull
  1998. hbox means that there is too much space between words.  More
  1999. specifically, the badness of any line is a number between 0
  2000. (perfect) and 10000 (horrible).  There is a parameter called {\tt
  2001. \\hbadness} whose default value is 1000\null.  Any line whose
  2002. badness is greater than {\tt \\hbadness} is reported as an
  2003. underfull hbox.  If the value of {\tt \\hbadness} is increased,
  2004. then fewer underfull hboxes will be reported. In fact {\tt
  2005. \\hbadness = 10000} will suppress the reporting of underfull
  2006. hboxes altogether. Similarly, if the words must be squeezed into
  2007. a line so that the spaces are very small or even so the words
  2008. extend a little into the right margin, then an overfull hbox
  2009. results. \toindex{hbadness}
  2010.  
  2011. %%%%%%%%%%%%%% restore original headline %%%%%%%%%%%%%%%%%%%%%%%%
  2012. \headline={\iftitlepage \hfil \global\titlepagefalse
  2013.                                       \else \gentleheadline \fi}
  2014.  
  2015. In a similar way, sometimes \TeX{} allows a line to be slightly
  2016. longer than {\tt \\hsize} in order to achieve a more balanced
  2017. appearance. The control word {\tt \\tolerance} determines when
  2018. this happens.  If the badness of a line is greater than {\tt
  2019. \\tolerance}, \TeX{} will make the line longer by adding a new word
  2020. at the end of the line, even though it might exceed the value of
  2021. {\tt \\hsize}. A line which is only slightly longer is set
  2022. without being reported. The control word {\tt \\hfuzz} determines
  2023. how much excess is allowed; the default is {\tt \\hfuzz
  2024. =~0.1~pt}.  A line that is more than slightly longer than {\tt \\hsize}
  2025. is obviously a serious problem; \TeX{} puts a slug in
  2026. the margin to make its point forcefully. It's possible to avoid
  2027. overfull hboxes altogether by increasing the value of {\tt \\tolerance}.
  2028. With {\tt \\tolerance = 10000} there will never be
  2029. overfull boxes or slugs. The default is {\tt \\tolerance = 200}\null.
  2030. \TeXref{29}
  2031. \toindex{hfuzz}
  2032. \toindex{tolerance}
  2033.  
  2034. The width of the slug is determined by the control word {\tt
  2035. \\overfullrule}.  Including {\tt \\overfullrule = 0 pt} in your
  2036. file will delete any further  printing of the slugs.  The
  2037. overfull boxes will still be there, of course, and they will
  2038. probably be harder to spot.
  2039. \toindex{overfullrule}
  2040.  
  2041. So we see why overfull boxes and underfull boxes are reported; we
  2042. can also change the reporting by changing the values of {\tt
  2043. \\badness}, {\tt \\hfuzz}, and {\tt \\tolerance}.  In addition, a
  2044. small value of {\tt \\hsize} obviously makes it more difficult to
  2045. set lines and causes more overfull and underfull hboxes to be
  2046. reported. These are warnings that you ignore at your own peril!
  2047.  
  2048. Adding new possibilities of hyphenation will sometimes eliminate
  2049. an overfull box. \TeX{} has automatic hyphenation and usually
  2050. finds good places to hyphenate a word; however, it's possible to
  2051. add hyphenations to let lines break at new places.  For example,
  2052. the automatic hyphenation will never put a hyphen in the word
  2053. ``database''.  If you type in {\tt data\\-base}, it will allow a
  2054. hyphen to be inserted after the second letter ``a'' in the word.
  2055. More generally, if you put {\tt \\hyphenation\lb data-base\rb} in
  2056. the beginning of your input file, then all occurrences of the
  2057. word ``database'' will allow hyphenation after the letter ``a''.
  2058. \TeXref{28} The log file will show the possible hyphenations on
  2059. the line containing the overfull or underfull box. Sometimes the
  2060. best solution to an overfull or underfull hbox is a little
  2061. judicious editing of the original document.
  2062. \toindex{hyphenation}
  2063.  
  2064. Our discussion has involved the setting of type into lines, that is,
  2065. the horizontal page structure.  There are several vertical \analog{}s.
  2066. Overfull and underfull hboxes indicate how well words are gathered
  2067. into lines.  Similarly, overfull and underfull vboxes are reported
  2068. when paragraphs are gathered to form pages.  A large table that
  2069. can't be broken in the middle, for example, can produce an underfull
  2070. vbox that is reported in the log file when the page being typeset is
  2071. completed.  The control word {\tt \\vbadness} works for the vertical
  2072. placement of text in the same way as {\tt \\hbadness} works for
  2073. horizontal text.
  2074. \toindex{vbadness}
  2075.  
  2076. \exercise Take a few paragraphs and print them using various (small)
  2077. values of {\tt \\hsize} to see what kind of overfull boxes result.
  2078. Repeat with various values of {\tt \\hbadness}, {\tt \\hfuzz}, and
  2079. {\tt \\tolerance}.
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086. \section{$\Bigl\{$Groups, $\bigl\{$Groups,
  2087.         $\{$and More Groups$\}\bigr\}\Bigr\}$}
  2088.  
  2089. The concept of gathering text into groups allows \TeX{} input
  2090. files to be greatly simplified.  A new group is started by the
  2091. character {\tt\lb} and terminated by the character {\tt \rb}\null.
  2092. Changes made within a group will lose their effect when the
  2093. group terminates.  So, for example if {\tt \lb \\bf three
  2094. boldface words\rb} appears in your text, the opening brace starts
  2095. the group, the {\tt \\bf} control word changes to a boldface
  2096. font, and the closing brace finishes up the group.  Upon
  2097. completion of the group the font being used is the one in effect
  2098. before the group started.  This is the (easier) way of having a
  2099. few words in a different font.  It's also possible to have groups
  2100. nested within groups.
  2101.  
  2102. \def\sectiontitle{$\Bigl\{$Groups, $\bigl\{$Groups, $\dots \bigr\}\Bigr\}$}
  2103.  
  2104. As another example, size changes can be made in the text that are
  2105. only temporary.  For example
  2106. \beginuser
  2107. \lb
  2108. \\hsize = 4 in
  2109. \\parindent = 0 pt
  2110. \\leftskip = 1 in
  2111. will produce a paragraph that is four
  2112. $\vdots$
  2113. (this is an easy mistake to make).
  2114. \\par
  2115. \rb
  2116. \enduser
  2117.  
  2118. {\hsize = 4 in
  2119. \parindent = 0 pt
  2120. \leftskip = 1 in
  2121. will produce a paragraph that is four inches wide with the text
  2122. offset into the paragraph by one inch regardless of the settings
  2123. in effect before the start of the group.  This paragraph is set
  2124. with those values. After the end of the group, the old settings
  2125. are in effect again. Note that it is necessary to include
  2126. {\tt \\par} or to use a blank line before the closing brace to end
  2127. the paragraph, since otherwise the group will end and \TeX{} will
  2128. go back to the old parameters before the paragraph is actually
  2129. typeset (this is an easy mistake to make). \par}
  2130.  
  2131. When a control word (like {\tt \\centerline}) acts on text
  2132. following it in braces, that text is implicitly in a group. Thus
  2133. {\tt \\centerline\lb\\bf A bold title\rb} will produce a \centred{}
  2134. boldface line, and the text following that line will be in
  2135. whatever font was in effect before the {\tt \\centerline} was
  2136. invoked.
  2137.  
  2138. The empty group {\tt\lb\rb} is useful.  One use allows accents to be
  2139. typeset with no accompanying letter.  For example, {\tt \\\~{}\lb\rb}
  2140. will print a tilde with no letter under it.  It can also be used to
  2141. stop \TeX{} from eating up consecutive spaces. Hence {\tt I use
  2142. \\TeX\lb\rb{} all the time}  will leave a space after ``\TeX'' in the
  2143. output. This is an alternative to using {\tt \\\sp} as we did in
  2144. Section~1.
  2145. \TeXref{19--21}
  2146.  
  2147. Grouping can also be used to avoid spaces in the middle of a word
  2148. when including accents. Either {\tt soup\\c\sp con} or {\tt
  2149. soup\\c\lb c\rb on} will produce the word soup\c{c}on.
  2150.  
  2151. \exercise Change the dimensions of one paragraph on a page using the
  2152. grouping idea.
  2153.  
  2154. \exercise Mathematicians sometime use the word ``i{f}f'' as an
  2155. abbreviation for ``if and only if''\null.  In this case it looks
  2156. better if the first and second letter ``f'' are {\sl not\/}
  2157. joined as a ligature.  How do you do this (there are several
  2158. solutions)?
  2159.  
  2160. It's really easy to forget to match braces properly.  The effect
  2161. can be dramatic; if you get output that suddenly changes to an
  2162. italic font for the rest of the document, a mismatched brace is
  2163. probably the cause.  If you have an extra {\tt \lb} \TeX{} will
  2164. give a message in the log file: {\tt (\\end occurred inside a
  2165. group at level 1)}. An extra {\tt\rb} will result in the message
  2166. \hbox{\tt! Too many \rb's.}
  2167.  
  2168. Here's a little hint to help you keep track of the braces in more
  2169. complicated groups: put the opening brace on a line by itself and
  2170. do the same for the closing brace.  If there are braces nested
  2171. within the original ones, put them on separate lines also, but
  2172. indent them a few spaces.  The text within the nested braces can
  2173. also be indented since \TeX{} ignores all spaces at the beginning
  2174. of a line. The matching braces will then stand out when you look
  2175. at your \TeX{} source file.  In fact, if your editor is smart
  2176. enough, you can create the two lines with the braces first and
  2177. then insert the appropriate material within them with automatic
  2178. indenting.
  2179.  
  2180. \exercise In section 2 we changed fonts the following method:
  2181. {\tt I started with roman type, \\it switched to italic type,
  2182. \\rm and returned to roman type}. Get the same result using the
  2183. idea of grouping.
  2184.  
  2185.  
  2186. \section{No math anxiety here!}
  2187.  
  2188. \TeX{} is at its best when typesetting mathematics.  The
  2189. conventions for doing this are many and complex, and the ability
  2190. of \TeX{} to take them into account makes the production of high
  2191. quality, attractive mathematical output possible.  If you plan to
  2192. produce papers with mathematical symbols in them, this section
  2193. will give you all the basics necessary for creating beautiful
  2194. output in almost all circumstances; \TeX{} may be used without
  2195. any mathematics, of course, and if this is your goal, then the
  2196. following two subsections are probably sufficient for your needs.
  2197.  
  2198. \subsection{Lots of new symbols}
  2199.  
  2200. Mathematical text is inserted into normal text in two possible
  2201. ways: it can be {\sl in-line\/}, that is, as part of the usual
  2202. lines of text.  It can also be {\sl displayed}, that is, \centred{}
  2203. in a gap between the usual text.  The results in the spacing and
  2204. placement of symbols can be quite different in each case.  The
  2205. in-line equation $\sum_{k=1}^{\infty} {1\over k^2} = {\pi^2\over6}$
  2206. is easily seen to be different from the same equation when
  2207. displayed:
  2208. $$\sum_{k=1}^{\infty} {1\over k^2} = {\pi^2\over6}.$$
  2209.  
  2210. Since the spacing and the fonts used for mathematics are quite
  2211. different from those of ordinary text, \TeX{} needs to be told
  2212. when mathematics rather than normal text is being typeset.  This
  2213. is done using the {\tt\$} symbol.  More specifically, mathematics
  2214. is typeset in-line by surrounding the symbols to be entered by
  2215. single dollar signs: {\tt \$$\ldots$\$}, and is typeset displayed
  2216. by surrounding the symbols to be entered by double dollar signs:
  2217. {\tt \$\$$\ldots$\$\$}\null.  Hence {\tt \$x = y+1\$} will give
  2218. $x=y+1$ in-line while {\tt \$\$x = y+1.\$\$} will display
  2219. $$x=y+1.$$
  2220.  
  2221. The spacing for both in-line and displayed mathematics is
  2222. completely controlled by \TeX\null.  Adding spaces to your input
  2223. has no effect at all.  What if you need a space or some text in
  2224. the middle of some mathematics?  You can insert text by inserting
  2225. it into an hbox (don't worry about the definition of an hbox for
  2226. now): {\tt \\hbox\lb$\ldots$\rb}\null.  This is particularly
  2227. useful for displayed mathematics.  Hence ``$x=y+1 \hbox{ whenever
  2228. } y=x-1$'' can be typeset using {\tt \$x=y+1 \\hbox\lb\ whenever
  2229. \rb y=x-1\$}. Note the spaces on either side of the word within
  2230. the braces. Usually it isn't necessary to insert spaces into
  2231. mathematical text, but here are the control sequences that do the
  2232. job.
  2233. \TeXref{167}
  2234.  
  2235. \maketable [Adding space to mathematical text]
  2236. \halign{
  2237. \strut \hfil # & \quad \hfil\tt# \hfil \quad
  2238.    & \hbox to 2cm{\hrulefill\vrule height 8pt#\vrule height 8pt\hrulefill} \cr
  2239.    Name & \rm Control Sequence & \hfil{}$\gets$Size$\to$\cr
  2240.    \noalign{\hrule} \noalign{\smallskip}
  2241.    Double quad         & \\qquad &\qquad \cr
  2242.    Quad                & \\quad  &\quad \cr
  2243.    Space               & \\\sp\   &\ \cr
  2244.    Thick space         & \\;     &$\;$\cr
  2245.    Medium space        & \\>     &$\>$\cr
  2246.    Thin space          & \\,     &$\,$\cr
  2247.    Negative thin space & \ \\!\    &$\!$\cr
  2248.        }
  2249.  
  2250. \toindex{quad}
  2251. \toindex{qquad}
  2252. \toindex{\sp}
  2253. \toindex{;}
  2254. \toindex{>}
  2255. \toindex{,}
  2256. \toindex{!}
  2257.  
  2258. If you look closely at the negative thin space, you'll notice
  2259. that, unlike the other entries, the two arms overlap.  This is
  2260. because the negative space is one in the opposite direction, that
  2261. is, while the other control sequences increase the amount of
  2262. space between two symbols being typeset, the negative thin space
  2263. decreases the space between them, even if it causes them to
  2264. overlap.
  2265.  
  2266. \exercise Typeset the following: $C(n,r) = n!/(r!\,(n-r)!)$\null. Note the
  2267. spacing in the denominator.
  2268. \bigskip
  2269.  
  2270. You shouldn't have any blank lines between the dollar signs
  2271. delimiting the mathematical text. \TeX{} assumes that all the
  2272. mathematical text being typeset is in one paragraph, and a blank
  2273. line starts a new paragraph; consequently, this will generate an
  2274. error message. This turns out to be useful, for one of the
  2275. easiest errors to make is to forget to put in the trailing dollar
  2276. sign(s) after the mathematical input (I promise that you'll do it
  2277. at least once while learning \TeX{}); if \TeX{} allowed more than
  2278. one paragraph to be between the dollars signs, then one omitted
  2279. trailing dollar sign might cause the rest of the document to be
  2280. typeset as mathematics.
  2281.  
  2282. Most mathematical text is entered in exactly the same way for
  2283. in-line typesetting as for displayed typesetting (except for the
  2284. surrounding dollar signs, of course). The exceptions, such as
  2285. aligning multiline displays and placing equation numbers at the
  2286. left or right margin will be discussed in the last part of this
  2287. section.
  2288.  
  2289. Many new symbols can appear when typesetting mathematics.  Most
  2290. of the ones that actually appear on the keyboard can be used
  2291. directly. The symbols {\tt + - / * = ' | < > (} and {\tt )} are
  2292. all entered directly. Here they are as mathematics: $+ - / * =\>
  2293. '\> | <\> >\> ( \> )$.
  2294.  
  2295. \exercise Typeset the equation $a+b=c-d=xy=w/z$ as in-line and
  2296. displayed mathematical text.
  2297.  
  2298. \exercise Typeset the equation $(fg)' = f'g + fg'$ as in-line and
  2299. displayed mathematical text.
  2300. \bigskip
  2301.  
  2302. Many other symbols, as you would expect, are predefined control
  2303. words.  All Greek letters are available.  Here is a table of them:
  2304. \TeXref{434}
  2305.  
  2306. \maketable [Greek letters]
  2307. \halign{
  2308. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2309.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2310. \noalign{\hrule} \noalign{\smallskip}
  2311. \alpha & \\alpha &\beta & \\beta &\gamma & \\gamma &\delta & \\delta \cr
  2312. \epsilon & \\epsilon & \varepsilon & \\varepsilon & \zeta & \\zeta &
  2313. \eta & \\eta \cr
  2314. \theta & \\theta & \vartheta & \\vartheta & \iota & \\iota & \kappa &
  2315. \\kappa \cr
  2316. \lambda & \\lambda & \mu & \\mu & \nu & \\nu & \xi & \\xi \cr
  2317. o & o & \pi & \\pi & \rho & \\rho & \varrho & \\varrho \cr
  2318. \sigma & \\sigma & \varsigma & \\varsigma & \tau & \\tau & \upsilon &
  2319. \\upsilon \cr
  2320. \phi & \\phi & \varphi & \\varphi & \chi & \\chi & \psi & \\psi \cr
  2321. \omega & \\omega & \Gamma & \\Gamma & \Delta & \\Delta & \Theta &
  2322. \\Theta \cr
  2323. \Lambda & \\Lambda & \Xi & \\Xi & \Pi & \\Pi & \Sigma & \\Sigma \cr
  2324. \Upsilon & \\Upsilon & \Phi & \\Phi & \Psi & \\Psi & \Omega & \\Omega \cr
  2325.        }
  2326.  
  2327. \toindex{alpha}
  2328. \toindex{beta}
  2329. \toindex{gamma}
  2330. \toindex{delta}
  2331. \toindex{epsilon}
  2332. \toindex{varepsilon}
  2333. \toindex{zeta}
  2334. \toindex{eta}
  2335. \toindex{theta}
  2336. \toindex{vartheta}
  2337. \toindex{iota}
  2338. \toindex{kappa}
  2339. \toindex{lambda}
  2340. \toindex{mu}
  2341. \toindex{nu}
  2342. \toindex{xi}
  2343. \toindex{pi}
  2344. \toindex{rho}
  2345. \toindex{varrho}
  2346. \toindex{sigma}
  2347. \toindex{varsigma}
  2348. \toindex{tau}
  2349. \toindex{upsilon}
  2350. \toindex{phi}
  2351. \toindex{varphi}
  2352. \toindex{chi}
  2353. \toindex{psi}
  2354. \toindex{omega}
  2355. \toindex{Gamma}
  2356. \toindex{Delta}
  2357. \toindex{Theta}
  2358. \toindex{Lambda}
  2359. \toindex{Xi}
  2360. \toindex{Pi}
  2361. \toindex{Sigma}
  2362. \toindex{Upsilon}
  2363. \toindex{Phi}
  2364. \toindex{Psi}
  2365. \toindex{Omega}
  2366.  
  2367.  
  2368. \exercise Typeset $\alpha\beta=\gamma+\delta$ as in-line and displayed
  2369. mathematical text.
  2370.  
  2371. \exercise Typeset $\Gamma(n) = (n-1)!$ as in-line and displayed
  2372. mathematical text.
  2373.  
  2374. Sometimes accents are put above or below symbols.  The control
  2375. words used for accents in mathematics are different from those
  2376. used for normal text.   The normal text control words may not be
  2377. used for mathematics and vice-versa.
  2378. \TeXref{135--136}
  2379.  
  2380. \maketable [Mathematical accents]
  2381. \halign{
  2382.    \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ &
  2383.       \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad  \cr
  2384.    \noalign{\hrule} \noalign{\smallskip}
  2385.    \hat o   & \\hat o   & \check o & \\check o  & \tilde o & \\tilde o \cr
  2386.    \acute o & \\acute o & \grave o & \\grave o  & \dot o & \\dot o \cr
  2387.    \ddot o  & \\ddot o  &\breve o  & \\breve o  & \bar o & \\bar o \cr
  2388.    \vec o   & \\vec o   & \widehat {abc} & \\widehat \lb abc\rb
  2389.                     & \widetilde {abc} & \\widetilde \lb abc\rb\cr
  2390.        }
  2391.  
  2392. \toindex{hat}
  2393. \toindex{check}
  2394. \toindex{tilde}
  2395. \toindex{acute}
  2396. \toindex{grave}
  2397. \toindex{dot}
  2398. \toindex{ddot}
  2399. \toindex{breve}
  2400. \toindex{bar}
  2401. \toindex{vec}
  2402. \toindex{widehat}
  2403. \toindex{widetilde}
  2404.  
  2405.  
  2406.  
  2407. Binary operators combine two mathematical objects to get another
  2408. object.  Ordinary addition and multiplication, for example,
  2409. combine two numbers to get another number, and so they are binary
  2410. operators. When a binary operator such as $+$ or $\times$ is
  2411. typeset, a little extra space is put around it. Here is a list of
  2412. some of the available binary operators:
  2413. \TeXref{436}
  2414.  
  2415. \maketable [Binary operators]
  2416. \halign{
  2417. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2418.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2419. \noalign{\hrule} \noalign{\smallskip}
  2420. \cdot & \\cdot &\times & \\times &\ast & \\ast &\star & \\star \cr
  2421. \circ & \\circ & \bullet & \\bullet & \div & \\div & \diamond & \\diamond \cr
  2422. \cap & \\cap & \cup & \\cup & \vee & \\vee & \wedge & \\wedge \cr
  2423. \oplus & \\oplus &\ominus & \\ominus & \otimes &\\otimes &\odot &\\odot \cr
  2424.        }
  2425.  
  2426. \toindex{cdot}
  2427. \toindex{times}
  2428. \toindex{ast}
  2429. \toindex{star}
  2430. \toindex{circ}
  2431. \toindex{bullet}
  2432. \toindex{div}
  2433. \toindex{diamond}
  2434. \toindex{cap}
  2435. \toindex{cup}
  2436. \toindex{vee}
  2437. \toindex{wedge}
  2438. \toindex{oplus}
  2439. \toindex{ominus}
  2440. \toindex{otimes}
  2441. \toindex{odot}
  2442.  
  2443. Ellipses are commonly used with binary operators.  The control
  2444. word {\tt \\cdots} will raise the dots so that they are level
  2445. with the binary operator. Thus {\tt \$a + \\cdots + z\$} will
  2446. produce $a + \cdots + z$.  The control word {\tt \\ldots} will
  2447. put the dots on the baseline, and so {\tt \$1\\ldots n\$}
  2448. produces $1\ldots n$.
  2449. \toindex{cdots}
  2450. \toindex{ldots}
  2451.  
  2452. \exercise Typeset: $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$.
  2453.  
  2454. \exercise Typeset: $2+4+6+\cdots +2n = n(n+1)$.
  2455. \bigskip
  2456.  
  2457. A relation indicates a property of two mathematical objects.  We
  2458. already know how to show two objects equal, or how to show one
  2459. number less than or greater than another number (since these are
  2460. symbols on most terminal keyboards).  To negate a relation, the
  2461. control word {\tt \\not} is put in front of the relation.  Here
  2462. are some relations:
  2463. \TeXref{436}
  2464. \toindex{not}
  2465.  
  2466. \maketable [Relations ]
  2467. \halign{
  2468. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2469.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2470. \noalign{\hrule} \noalign{\smallskip}
  2471. \leq  & \\leq  &\not\leq & \\not \\leq
  2472.        & \geq & \\geq & \not\geq & \\not \\geq \cr
  2473. \equiv & \\equiv & \not\equiv & \\not \\equiv
  2474.        & \sim & \\sim & \not\sim & \\not \\sim \cr
  2475. \simeq & \\simeq & \not\simeq & \\not \\simeq
  2476.        & \approx & \\approx & \not\approx & \\not \\approx \cr
  2477. \subset & \\subset & \subseteq & \\subseteq
  2478.         & \supset & \\supset & \supseteq & \\supseteq \cr
  2479. \in & \\in & \ni & \\ni & \parallel & \\parallel & \perp & \\perp \cr
  2480.        }
  2481.  
  2482. \toindex{leq}
  2483. \toindex{geq}
  2484. \toindex{equiv}
  2485. \toindex{sim}
  2486. \toindex{simeq}
  2487. \toindex{approx}
  2488. \toindex{subset}
  2489. \toindex{subseteq}
  2490. \toindex{supset}
  2491. \toindex{supseteq}
  2492. \toindex{in}
  2493. \toindex{ni}
  2494. \toindex{parallel}
  2495. \toindex{perp}
  2496.  
  2497.  
  2498. \exercise
  2499. Typeset: $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  2500.  
  2501. \exercise
  2502. Typeset: $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  2503.  
  2504. Here are some other available mathematical symbols:\TeXref{435--438}
  2505.  
  2506. \maketable [Miscellaneous symbols ]
  2507. \halign{
  2508. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2509.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2510. \noalign{\hrule} \noalign{\smallskip}
  2511. \aleph & \\aleph & \ell & \\ell & \Re & \\Re & \Im & \\Im \cr
  2512. \partial & \\partial & \infty & \\infty & \| & \\| & \angle & \\angle \cr
  2513. \nabla & \\nabla & \backslash &\\backslash & \forall & \\forall
  2514.               & \exists & \\exists \cr
  2515. \neg & \\neg & \flat & \\flat & \sharp & \\sharp & \natural & \\natural \cr
  2516.           }
  2517.  
  2518. \toindex{aleph}
  2519. \toindex{ell}
  2520. \toindex{Re}
  2521. \toindex{Im}
  2522. \toindex{partial}
  2523. \toindex{infty}
  2524. \toindex{|}
  2525. \toindex{angle}
  2526. \toindex{nabla}
  2527. \toindex{backslash}
  2528. \toindex{forall}
  2529. \toindex{exists}
  2530. \toindex{neg}
  2531. \toindex{flat}
  2532. \toindex{sharp}
  2533. \toindex{natural}
  2534.  
  2535. \exercise Typeset: $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  2536.  
  2537. \subsection{Fractions}
  2538.  
  2539. There are two methods of typesetting a fraction: it can be
  2540. typeset either in the form $1/2$ or in the form ${1\over2}$\null.
  2541. The first case is just entered with no special control sequences,
  2542. that is, {\tt \$1/2\$}\null.  The second case uses the control
  2543. word {\tt \\over} and the following pattern: {\tt \lb
  2544. <numerator> \\over <denominator>\rb}\null. Hence {\tt \$\$\lb a+b
  2545. \\over c+d\rb.\$\$} gives \TeXref{139--140}
  2546. \toindex{over} $${a+b\over c+d}.$$
  2547.  
  2548. \exercise Typeset the following: ${a+b\over c}\quad {a\over b+c}
  2549. \quad {1\over a+b+c} \not= {1\over a}+{1\over b}+{1\over c}$.
  2550.  
  2551. \exercise Typeset: What are the points where
  2552. ${\partial \over \partial x} f(x,y) = {\partial \over \partial y}
  2553. f(x,y) = 0$?
  2554.  
  2555. \subsection{Subscripts and superscripts}
  2556.  
  2557. Subscripts and superscripts are particularly easy to enter using
  2558. \TeX\null. The characters {\tt \_{}} and {\tt \^{}} are used to
  2559. indicate that the next character is a subscript or a superscript.
  2560. Thus {\tt \$x\^{}2\$} gives $x^2$ and {\tt \$x\_{}2\$} gives
  2561. $x_2$\null.  To get several characters as a subscript or
  2562. superscript, they are grouped together within braces. Hence we
  2563. can use {\tt \$x\^{}\lb 21\rb\$} to get $x^{21}$ and {\tt \$x\_{}\lb
  2564. 21\rb\$} to get $x_{21}$\null. Notice that the
  2565. superscripts and subscripts are automatically typeset in a
  2566. smaller type size. The situation is only slightly more
  2567. complicated for a second layer of subscripts or superscripts.
  2568. You can {\sl not\/} use {\tt \$x\_{}2\_{}3\$} since this could
  2569. have two possible interpretations, namely, {\tt \$x\_{}\lb 2\_{}3\rb\$}
  2570. or {\tt \$\lb x\_{}2\rb\_{}3\$}; this gives two
  2571. different results: $x_{2_3}$ and ${x_2}_3$, the first of which is
  2572. the usual mathematical subscript notation.  Thus you must put in
  2573. the complete braces to describe multiple layers of subscripts and
  2574. superscripts.  They may be done to any level.
  2575. \TeXref{128--130}
  2576.  
  2577. To use both subscripts and superscripts on one symbol, you use
  2578. both the {\tt \_{}} and {\tt \^{}} in either order.  Thus either
  2579. {\tt \$x\_{}2\^{}1\$} or {\tt\$x\^{}1\_{}2\$} will give $x_2^1$.
  2580.  
  2581. \exercise
  2582. Typeset each of the following: $e^x \quad e^{-x} \quad
  2583. e^{i\pi}+1=0 \quad x_0 \quad x_0^2 \quad {x_0}^2 \quad 2^{x^x}$.
  2584.  
  2585. \exercise Typeset:
  2586. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}
  2587. + {\partial^2 f \over\partial y^2}$.
  2588. \bigskip
  2589.  
  2590. A similar method is used for summations and integrals.  The input
  2591. of {\tt \$\\sum\_{}\lb k=1\rb\^{}n k\^{}2\$} will give $\sum_{k=1}^n
  2592. k^2$, and {\tt \$\\int\_{}0\^{}x f(t) dt\$} will
  2593. give $\int_0^x f(t) dt$.
  2594. \TeXref{144--145}
  2595. \toindex{sum}
  2596. \toindex{int}
  2597.  
  2598. Another use of this type of input is for expressions
  2599. involving limits.  You can use
  2600. {\tt \$\\lim\_\lb n\\to \\infty\rb (\lb n+1 \\over n\rb)\^{}n = e\$}
  2601. to get $\lim_{n\to \infty} ({n+1\over n})^n = e$.
  2602. \toindex{lim}
  2603.  
  2604. \exercise Typeset the following expression: $\lim_{x\to 0}
  2605. (1+x)^{1\over x}=e$.
  2606.  
  2607. \exercise Typeset: The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  2608.  
  2609. \exercise Typeset: $\lim_{x\to {0^+}} x^x = 1$.
  2610. \bigskip
  2611.  
  2612. Here's a hint to make integrals look a little nicer: look at the
  2613. difference between $\int_0^x f(t) dt$ and $\int_0^x f(t)\, dt$\null.
  2614. In the second case there is a little extra space after
  2615. $f(t)$, and it looks nicer; {\tt \\,} was used to add the
  2616. additional space.
  2617. \toindex{,}
  2618.  
  2619. \exercise Typeset the following integral: $\int_0^1 3x^2\,dx = 1$.
  2620.  
  2621. \subsection{Roots, square and otherwise}
  2622.  
  2623. To typeset a square root it is only necessary to use the construction
  2624. {\tt \\sqrt\lb$\ldots$\rb}\null. Hence {\tt \$\\sqrt\lb x\^{}2+y\^{}2\rb\$}
  2625. will give $\sqrt{x^2+y^2}$\null.  Notice that \TeX{} takes care of the
  2626. placement of symbols and the height and length of the radical.
  2627. To make cube or other roots, the control words {\tt \\root} and {\tt
  2628. \\of} are used.  You get $\root n \of {1+x^n}$ from the
  2629. input\TeXref{130--131} {\tt \$\\root n \\of \lb1+x\^{}n\rb\$}.
  2630. \toindex{root}
  2631. \toindex{sqroot}
  2632.  
  2633. A possible alternative is to use the control word {\tt \\surd}; the
  2634. input {\tt \$\\surd 2\$} will produce $\surd 2$.
  2635. \toindex{surd}
  2636.  
  2637. \exercise Typeset the following: $\sqrt2 \quad \sqrt {x+y\over x-y}
  2638. \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  2639.  
  2640. \exercise Typeset: $\|x\| = \sqrt{x\cdot x}$.
  2641.  
  2642. \exercise Typeset:
  2643. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  2644.  
  2645.  
  2646. \subsection{Lines, above and below}
  2647.  
  2648. Use the constructions {\tt \\overline\lb$\ldots$\rb} and
  2649. {\tt \\underline\lb$\ldots$\rb} to put lines above or below mathematical
  2650. expressions. Hence {\tt \$\\overline\lb x+y\rb=\\overline x + \\overline
  2651. y\$} gives $\overline{x+y}=\overline x + \overline y$\null.
  2652. But notice that the lines over the letters are at
  2653. different heights, and so some care is necessary. The use of {\tt
  2654. \\overline\lb\\strut x\rb} will raise the height of the line
  2655. over\TeXref{130--131} $x$\null.
  2656. \toindex{overline}
  2657. \toindex{underline}
  2658.  
  2659. To underline non-mathematical text, use {\tt \\underbar\lb$\dots$\rb}.
  2660. \toindex{underbar}
  2661.  
  2662. \exercise Typeset the following: $\underline x \quad \overline y
  2663. \quad \underline{\overline{x+y}}$.
  2664.  
  2665.  
  2666. \subsection{Delimiters large and small}
  2667.  
  2668. The most commonly used mathematical delimiters are brackets,
  2669. braces, and parentheses.  As we have seen, they may be produced
  2670. by using {\tt [ ] \\\lb\ \\\rb\ ( )} to get
  2671. $[\>]\>\{\>\}\>(\>)\>$. Sometimes larger delimiters increase the
  2672. clarity of mathematical expressions, as in
  2673. $$\bigl(a\times(b+c)\bigr) \bigl((a\times b)+c\bigr).$$ To make
  2674. larger left delimiters the control words {\tt \\bigl}, {\tt
  2675. \\Bigl}, {\tt \\biggl}, and {\tt \\Biggl} are used in front of
  2676. the delimiter; similarly, {\tt \\bigr}, {\tt \\Bigr}, {\tt
  2677. \\biggr}, and {\tt \\Biggr} are used\TeXref{145--147} for the
  2678. right delimiters. Hence {\tt \$\\Bigl[\$} and {\tt \$\\Bigr]\$}
  2679. will produce $\Bigl[$ and $\Bigr]$.
  2680.  
  2681. \toindex{bigl}
  2682. \toindex{Bigl}
  2683. \toindex{biggl}
  2684. \toindex{Biggl}
  2685. \toindex{bigr}
  2686. \toindex{Bigr}
  2687. \toindex{biggr}
  2688. \toindex{Biggr}
  2689.  
  2690. Here is a table to compare the size of some of the delimiters.
  2691.  
  2692. %% \everycr can add 4 points between lines in the following table %%
  2693. \everycr={\noalign{\vskip 4 pt}}
  2694. \maketable [Delimiters of various sizes]
  2695. \halign{
  2696. \strut \hfil$#$ & \quad \tt# \hfil \quad\qquad
  2697.       &\hfil$#$ & \quad \tt# \hfil \quad\qquad
  2698.       &\hfil$#$ & \quad \tt# \hfil \quad\qquad
  2699.       &\hfil$#$ & \quad \tt# \hfil \cr
  2700. \noalign{\hrule} \noalign{\smallskip}
  2701. \{ & \\\lb & \} & \\\rb & ( & ( & ) & )\cr
  2702. \bigl\{ & \\bigl\\\lb & \bigr\} & \\bigr\\\rb & \bigl( & \\bigl( & \bigr) &
  2703. \\bigr)\cr
  2704. \Bigl\{ & \\Bigl\\\lb & \Bigr\} & \\Bigr\\\rb & \Bigl( & \\Bigl( & \Bigr) &
  2705. \\Bigr)\cr
  2706. \biggl\{ & \\biggl\\\lb & \biggr\} & \\biggr\\\rb & \biggl(
  2707.          & \\biggl( & \biggr) & \\biggr) \cr
  2708. \Biggl\{ & \\Biggl\\\lb & \Biggr\} & \\Biggr\\\rb & \Biggl(
  2709.          & \\Biggl( & \Biggr) & \\Biggr)\cr
  2710.        }
  2711.  
  2712. \everycr={}
  2713.  
  2714. If you want, you can let \TeX{} choose the size of delimiter by
  2715. using the control words {\tt \\left} and {\tt \\right} before
  2716. your delimiters.
  2717. \TeXref{148}Thus {\tt \\left[$\ldots$\\right]}  will cause the material
  2718. to be enclosed by brackets that are appropriately big.  {\bf Note
  2719. well:} each use of a {\tt \\left} delimiter must have a matching
  2720. {\tt \\right} delimiter (although the delimiters themselves may be
  2721. different). Hence {\tt \$\$\\left|\lb a+b \\over
  2722. c+d\rb\\right|.\$\$} gives $$\left|{a+b \over c+d}\right|.$$
  2723.  
  2724. \maketable [Mathematical delimiters]
  2725. \halign{
  2726. \strut \hfill$#$ & \quad \tt # \qquad\qquad &
  2727.        \hfill$#$ & \quad \tt # \qquad\qquad &
  2728.        \hfill$#$ & \quad \tt #  \cr
  2729. \noalign{\hrule} \noalign{\smallskip}
  2730. (       & (        & )          & )           & [        & [         \cr
  2731. ]       & ]        &\{          & \\\lb       & \}       & \\\rb     \cr
  2732. \lfloor & \\lfloor &\rfloor     &\\rfloor     & \lceil   & \\lceil   \cr
  2733. \rceil  & \\rceil  &\langle     & \\langle    & \rangle  & \\rangle  \cr
  2734. /       & /        & \backslash & \\backslash &|         & |         \cr
  2735. \|      & \\|      &\uparrow    & \\uparrow   & \Uparrow & \\Uparrow \cr
  2736. \downarrow & \\downarrow & \Downarrow & \\Downarrow
  2737.                         & \updownarrow & \\updownarrow \cr
  2738. \Updownarrow & \\Updownarrow \cr
  2739.        }
  2740.  
  2741. \toindex{lfloor}
  2742. \toindex{rfloor}
  2743. \toindex{lceil}
  2744. \toindex{rceil}
  2745. \toindex{langle}
  2746. \toindex{rangle}
  2747. \toindex{|}
  2748. \toindex{uparrow}
  2749. \toindex{Uparrow}
  2750. \toindex{downarrow}
  2751. \toindex{Downarrow}
  2752. \toindex{updownarrow}
  2753. \toindex{Updownarrow}
  2754.  
  2755. \exercise Typeset $\bigl \lceil \lfloor x \rfloor \bigr \rceil
  2756.               \leq \bigl \lfloor \lceil x \rceil \bigr \rfloor$.
  2757.  
  2758. \subsection{Those special functions}
  2759.  
  2760. There are several types of functions that appear frequently in
  2761. mathematical text.  In an equation like ``$\sin^2x + \cos^2x =
  2762. 1$'' the trigonometric functions ``sin'' and ``cos'' are in roman
  2763. rather than italic type. This is the usual mathematical
  2764. convention to indicate that it is a function being described and
  2765. not the product of three variables.  The control words {\tt
  2766. \\sin} and {\tt \\cos} will use the right typeface automatically.
  2767. Here is a table of these and some other special functions:
  2768. \TeXref{162}
  2769.  
  2770. \maketable [Special mathematical functions]
  2771. \halign{
  2772.    \strut \tt {\\}#\hfil && \quad \tt {\\}#\hfil \cr
  2773.    \noalign{\hrule} \noalign{\smallskip}
  2774.    sin    & cos    & tan  & cot  & sec  & csc & arcsin & arccos \cr
  2775.    arctan & sinh   & cosh & tanh & coth & lim & sup    & inf    \cr
  2776.    limsup & liminf & log  & ln   & lg   & exp & det    & deg    \cr
  2777.    dim    & hom    & ker  & max  & min  & arg & gcd    & Pr     \cr
  2778.        }
  2779.  
  2780. \toindex{sin}
  2781. \toindex{cos}
  2782. \toindex{tan}
  2783. \toindex{cot}
  2784. \toindex{sec}
  2785. \toindex{csc}
  2786. \toindex{arcsin}
  2787. \toindex{arccos}
  2788. \toindex{arctan}
  2789. \toindex{sinh}
  2790. \toindex{cosh}
  2791. \toindex{tanh}
  2792. \toindex{coth}
  2793. \toindex{lim}
  2794. \toindex{sup}
  2795. \toindex{inf}
  2796. \toindex{limsup}
  2797. \toindex{liminf}
  2798. \toindex{log}
  2799. \toindex{ln}
  2800. \toindex{lg}
  2801. \toindex{exp}
  2802. \toindex{det}
  2803. \toindex{deg}
  2804. \toindex{dim}
  2805. \toindex{hom}
  2806. \toindex{ker}
  2807. \toindex{max}
  2808. \toindex{min}
  2809. \toindex{arg}
  2810. \toindex{gcd}
  2811. \toindex{Pr}
  2812.  
  2813. \exercise Typeset: $\sin(2\theta) = 2\sin\theta\cos\theta \quad
  2814. \cos(2\theta) = 2\cos^2\theta - 1  $.
  2815.  
  2816. \exercise Typeset: $$\int \csc^2x\, dx = -\cot x+ C
  2817. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  2818. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  2819.  
  2820. \exercise Typeset: $$\tan(2\theta) = {2\tan\theta \over
  2821. 1-\tan^2\theta}.$$
  2822.  
  2823.  
  2824. \subsection{Hear ye, hear ye!}
  2825.  
  2826. There is a particular macro that is used in almost every
  2827. mathematical paper, and is different enough to require a special
  2828. explanation. This is the {\tt \\proclaim} macro.  It is used when
  2829. stating theorems, corollaries, propositions, and the like.  The
  2830. paragraph following {\tt \\proclaim} is broken into two parts:
  2831. the first part goes up to and including the first period that is
  2832. followed by a space, and the second part is the rest of the
  2833. paragraph. \TeXref{202--203}The idea is that the first part
  2834. should be something like ``Theorem 1.'' or ``Corollary B.'' The
  2835. second part is the statement of the theorem or corollary.  Here
  2836. is an example:
  2837. \toindex{proclaim}
  2838.  
  2839. \beginliteral
  2840. \proclaim Theorem 1 (H.~G.~Wells). In the country of the blind,
  2841. the one-eyed man is king.
  2842. @endliteral
  2843.  
  2844. \noindent gives
  2845.  
  2846. \proclaim Theorem 1 (H.~G.~Wells). In the country of the blind,
  2847. the one-eyed man is king.
  2848.  
  2849. The statement of the theorem may contain mathematical expressions, of
  2850. course.
  2851.  
  2852. \vfill\eject
  2853. \exercise Typeset:
  2854. \nobreak
  2855. \proclaim Theorem (Euclid). There exist an infinite number of
  2856. primes.
  2857.  
  2858. \exercise Typeset:
  2859. \proclaim Proposition 1.
  2860. $\root n \of {\prod_{i=1}^n X_i} \leq {1 \over n} \sum_{i=1}^n X_i$
  2861. with equality if and only if $X_1=\cdots=X_n$.
  2862.  
  2863. \subsection{Matrices}
  2864.  
  2865. Matrices are typeset using combinations of the alignment
  2866. character {\tt \&} and the control word {\tt \\cr} to indicate
  2867. the end of the line.  Start with {\tt \$\$\\pmatrix\lb$\dots$\rb\$\$}.
  2868. Into the space between the braces go the rows of the matrix, each
  2869. one ended by {\tt \\cr}.  The entries are separated by the
  2870. {\tt \&}\null.  For example the input
  2871. \TeXref{176--178}
  2872.  
  2873. \beginliteral
  2874. $$\pmatrix{
  2875. a & b & c & d \cr
  2876. b & a & c+d & c-d \cr
  2877. 0 & 0 & a+b & a-b \cr
  2878. 0 & 0 & ab  & cd \cr
  2879. }.$$
  2880. @endliteral
  2881.  
  2882. \noindent
  2883. gives as printed output
  2884. $$\pmatrix{
  2885. a & b & c & d \cr
  2886. b & a & c+d & c-d \cr
  2887. 0 & 0 & a+b & a-b \cr
  2888. 0 & 0 & ab  & cd \cr
  2889. }.$$
  2890. \toindex{pmatrix}
  2891.  
  2892. The matrix entries in our examples have all been \centred{}
  2893. within their columns with a little space on each side.  They can
  2894. be made flush right or flush left by inserting {\tt \\hfill}
  2895. before or after the entry. Notice the differences between the
  2896. following example and the previous one.
  2897.  
  2898. \beginliteral
  2899. $$\pmatrix{
  2900. a & b & c \hfill  & \hfill d  \cr
  2901. b & a & c+d      & c-d      \cr
  2902. 0 & 0 & a+b      & a-b      \cr
  2903. 0 & 0 & ab \hfill & \hfill cd \cr
  2904. }.$$
  2905. @endliteral
  2906.  
  2907. \noindent
  2908. gives as printed output
  2909.  
  2910. $$\pmatrix{
  2911. a & b & c \hfill & \hfill d   \cr
  2912. b & a & c+d     & c-d       \cr
  2913. 0 & 0 & a+b     & a-b       \cr
  2914. 0 & 0 & ab \hfill & \hfill cd \cr
  2915. }.$$
  2916.  
  2917.  
  2918. \vbox{
  2919. \exercise Typeset
  2920. $$ I_4 = \pmatrix{ 1 &0 &0 &0 \cr
  2921.                    0 &1 &0 &0 \cr
  2922.                    0 &0 &1 &0 \cr
  2923.                    0 &0 &0 &1 \cr}$$
  2924. }
  2925.  
  2926. It's possible to have matrices that use other delimiters. Using
  2927. {\tt \\matrix} instead of {\tt \\pmatrix} will leave off the
  2928. parentheses, so the delimiters must be explicitly included using
  2929. {\tt \\left} and {\tt \\right}.  Here is how we can change the
  2930. matrix of our first example.
  2931. \toindex{matrix}
  2932. \toindex{left}
  2933. \toindex{right}
  2934.  
  2935. \beginliteral
  2936. $$ \left |
  2937. \matrix{
  2938. a & b & c & d \cr
  2939. b & a & c+d & c-d \cr
  2940. 0 & 0 & a+b & a-b \cr
  2941. 0 & 0 & ab  & cd \cr
  2942. }
  2943. \right | $$
  2944. @endliteral
  2945.  
  2946. \noindent
  2947. gives as printed output
  2948. $$ \left |
  2949. \matrix{
  2950. a & b & c & d \cr
  2951. b & a & c+d & c-d \cr
  2952. 0 & 0 & a+b & a-b \cr
  2953. 0 & 0 & ab  & cd \cr
  2954. }
  2955. \right | $$
  2956.  
  2957. It's even possible to use {\tt \\left.} and {\tt \\right.} to
  2958. indicate that the opening or closing delimiter is deleted (note
  2959. the use of the period).
  2960.  
  2961. \exercise Use a matrix construction to typeset
  2962.  
  2963. $$ |x| = \left\{ \matrix{ x & x \ge 0 \cr
  2964.                          -x & x \le 0 \cr} \right.$$
  2965.  
  2966. This exercise and more general constructions of this type
  2967. may also be typeset using the {\tt \\cases} macro.
  2968. \TeXref{175}
  2969.  
  2970. Sometimes ellipses are used within matrices.  The control words
  2971. {\tt \\cdots}, {\tt \\vdots}, and {\tt \\ddots} can be used to
  2972. insert horizontal, vertical, and diagonal dots.
  2973.  
  2974. Thus we can use
  2975. \beginliteral
  2976. $$ \left [
  2977. \matrix{
  2978. aa     & \cdots & az     \cr
  2979. \vdots & \ddots & \vdots \cr
  2980. za     & \cdots & zz     \cr
  2981. }
  2982. \right ] $$
  2983. @endliteral
  2984.  
  2985. \noindent
  2986. to get as printed output
  2987. $$ \left [
  2988. \matrix{
  2989. aa     & \cdots & az     \cr
  2990. \vdots & \ddots & \vdots \cr
  2991. za     & \cdots & zz     \cr
  2992. }
  2993. \right ] $$
  2994.  
  2995.  
  2996. Matrices may also be typeset in-line, but they are pretty ugly
  2997. unless they have a small number of rows.
  2998.  
  2999.  
  3000. \subsection{Displayed equations}
  3001.  
  3002. All of the mathematics covered so far has identical input whether
  3003. it is to be typeset in-line or displayed.  At this point we'll
  3004. look at some situations that apply to displayed equations only.
  3005.  
  3006. The first is that of aligning multiline displays.  This is done with
  3007. the alignment character {\tt \&} and the control words {\tt \\cr} and
  3008. {\tt \\eqalign}. Starting with {\tt \$\$\\eqalign\lb$\dots$\rb\$\$},
  3009. the equations to be aligned are entered with each one terminated by
  3010. {\tt \\cr}.  In each equation there should be one alignment symbol
  3011. {\tt \&} to indicate where the alignment should take place.  This is
  3012. usually done at the equal signs, although it is not necessary to do
  3013. so.  For example
  3014. \TeXref{190--192}
  3015. \toindex{eqalign}
  3016.  
  3017. \beginliteral
  3018. $$\eqalign{
  3019. a+b &= c+d \cr
  3020. x &= w + y + z \cr
  3021. m + n + o + p &= q \cr
  3022. }$$
  3023. @endliteral
  3024.  
  3025.  
  3026. \noindent
  3027. yields
  3028. $$\eqalign{
  3029. a+b &= c+d \cr
  3030. x &= w + y + z \cr
  3031. m + n + o + p &= q \cr
  3032. }$$
  3033.  
  3034. Displayed equations can be numbered at either the right or left
  3035. margin.  When the control word {\tt \\eqno} appears in a displayed
  3036. equation, everything after the control word is put at the right
  3037. margin.  Hence {\tt \$\$ x+y=z. \\eqno (1)\$\$} yields
  3038. $$ x+y=z. \eqno (1)$$
  3039. To number an equation at the left margin, use {\tt \\leqno}
  3040. in place of {\tt \\eqno}.
  3041. \toindex{eqno}
  3042. \toindex{leqno}
  3043.  
  3044. It's possible to number aligned equations by using the control
  3045. word {\tt \\eqalignno}.  The alignment character {\tt \&} is
  3046. used to separate the equation from the equation number.
  3047. \beginliteral
  3048. $$\eqalignno{
  3049. a+b &= c+d & (1) \cr
  3050. x &= w + y + z \cr
  3051. m + n + o + p &= q & * \cr
  3052. }$$
  3053. @endliteral
  3054.  
  3055. \noindent
  3056. yields
  3057. $$\eqalignno{
  3058. a+b &= c+d & (1) \cr
  3059. x &= w + y + z \cr
  3060. m + n + o + p &= q & * \cr
  3061. }$$
  3062.  
  3063. Use {\tt \\leqalignno} to put the equation numbers on the left.
  3064. \TeXref{192--193}
  3065. \toindex{eqalignno}
  3066. \toindex{leqalignno}
  3067.  
  3068. Finally, suppose some text needs to appear in the middle of a
  3069. displayed equation.  This can be done by putting it in an hbox.
  3070. We will describe hboxes in more detail in the next section.
  3071. For now we want to use them to temporarily resume using ordinary
  3072. roman type and to also allow the insertion of space between
  3073. words (remember that all spaces are ignored when typesetting
  3074. mathematics). Hence
  3075. {\tt \$\$X=Y \\hbox\lb{} if and only if \rb x=y.\$\$} will give
  3076. $$X=Y \hbox{ if and only if } x=y.$$
  3077. Note carefully the spaces in the hbox.
  3078.  
  3079. \exercise Do some of the challenge problems on pages 180--181 of The
  3080. \TeX book.
  3081.  
  3082.  
  3083.  
  3084.  
  3085. \section{All in a row}
  3086.  
  3087. It's not uncommon to want to put a table in the middle of some
  3088. text. Fortunately \TeX{} makes it easy to do this.  In fact there
  3089. are two separate methods of aligning text.  The first is by using
  3090. the tabbing environment.  This is similar to setting the tab
  3091. stops on a typewriter. Each line is handled individually,
  3092. according to set tab columns, but with greater flexibility than
  3093. that provided by a typewriter. The second is the horizontal
  3094. alignment environment which typesets the whole table at once
  3095. using a prescribed pattern.
  3096.  
  3097. \subsection{Picking up the tab}
  3098.  
  3099. To align material using the tabbing environment, you must first
  3100. set the tab positions using the {\tt \\settabs} control word.
  3101. Having done this, a line to use these tabs starts with the
  3102. control symbol {\tt \\+ } and ends with {\tt \\cr } (remember
  3103. that the actual spacing on lines in the input file in
  3104. unimportant). \toindex{settabs}
  3105.  
  3106. The easiest way to use the {\tt \\settabs} control word is to put
  3107. the text into equal columns.
  3108. \TeXref{231}
  3109. Using {\tt \\settabs 4 \\columns} will set the tabs that will
  3110. produce four equal columns.  The tabbing is then done by using
  3111. the alignment character {\tt \&} to move to the next tab stop.
  3112. So, for example, \toindex{columns}
  3113.  
  3114. \beginliteral
  3115. \settabs 4 \columns
  3116. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3117. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3118. \+ & Prince Edward Island & Newfoundland \cr
  3119. @endliteral
  3120.  
  3121.  
  3122. \noindent
  3123. will produce the table
  3124. \vskip\baselineskip
  3125.  
  3126. \settabs 4 \columns
  3127. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3128. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3129. \+ & Prince Edward Island & Newfoundland \cr
  3130.  
  3131. Notice that it is possible to skip over some tab positions, and
  3132. it is not necessary to use all of the tabs in a given line. To
  3133. make the same table using five columns, it is only necessary to
  3134. use {\tt \\settabs 5 \\columns} to reset the tab stops; then the
  3135. same three lines from the last example will produce:
  3136. \vskip\baselineskip
  3137.  
  3138. \settabs 5 \columns
  3139. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3140. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3141. \+ & Prince Edward Island & Newfoundland \cr
  3142.  
  3143. In this example, the columns are smaller, of course.  In fact
  3144. there are two overlapping entries in the last row.  This is
  3145. because \TeX{} will tab to the next tab position even if (unlike
  3146. a typewriter) it means going backward on the page.
  3147.  
  3148. There is an interesting relationship between grouping and
  3149. tabbing. The {\tt \\settabs} values are only applicable to the
  3150. group in which it is defined, as would be expected.  Thus it is
  3151. possible to temporarily change the tab settings by grouping
  3152. within braces.  In addition, each table entry is in a group of
  3153. its own. Hence we may make a single entry boldface, for example,
  3154. by using {\tt \\bf}  without braces. In addition, for any column
  3155. but the last one it is possible to \centre{} the entry or to
  3156. align it either on the left or on the right, or to fill a column
  3157. with a line or dots. Each entry has an implicit {\tt \\hfil} at
  3158. the end so that it will be at the left of the column by default.
  3159. Adding {\tt \\hfil} at the beginning of the entry will then cause
  3160. it to be \centred{}, just as with the {\tt \\line} control word.
  3161. Adding {\tt \\hfill} to the beginning will cause the entries to
  3162. be pushed to the right ({\tt \\hfill} acts just like {\tt \\hfil}
  3163. in that it absorbs excess space; when both {\tt \\hfil} and {\tt
  3164. \\hfill} appear, the {\tt \\hfill} takes precedence).
  3165. \toindex{hfill}
  3166.  
  3167. \beginliteral
  3168. \settabs 4 \columns
  3169. \+ \hfil British Columbia & \hfill Alberta \qquad & \bf Saskatchewan
  3170. @hskip 2.5in                                  & Manitoba \cr
  3171. \+ \hfil Ontario & \hfill Quebec \qquad & \bf New Brunswick
  3172. @hskip 2.5in                                 & Nova Scotia \cr
  3173. \+ \hfil ---  & \hfill * \qquad & \bf Newfoundland
  3174. @hskip 2.5in          & Prince Edward Island \cr
  3175. \+ \dotfill && \hrulefill & \cr
  3176. @endliteral
  3177.  
  3178. \noindent
  3179. will produce a table with the first column \centred{}, the second
  3180. column flush right with a {\tt \\qquad} of padding, and the third
  3181. column boldface. The control words {\tt \\dotfill} and {\tt \\hrulefill}
  3182. give alternative column entries.
  3183. \toindex{dotfill}
  3184. \toindex{hrulefill}
  3185. \vskip\baselineskip
  3186.  
  3187. \settabs 4 \columns
  3188. \+ \hfil British Columbia & \hfill Alberta \qquad & \bf Saskatchewan
  3189.                                         & Manitoba \cr
  3190. \+ \hfil Ontario & \hfill Quebec \qquad & \bf New Brunswick
  3191.                                         & Nova Scotia \cr
  3192. \+ \hfil ---  & \hfill * \qquad & \bf Newfoundland &
  3193.                       Prince Edward Island \cr
  3194. \+ \dotfill && \hrulefill & \cr
  3195.  
  3196. \exercise Take the table of Canadian provinces above and \centre{} each
  3197. entry within its column.
  3198.  
  3199. The tab positions can be set with much more flexibility than just
  3200. in equal columns.  The general pattern is to use a sample line of
  3201. the form {\tt \\settabs \\+ $\ldots$ \& $\ldots$ \& $\ldots$ \\cr}.
  3202. The spacing between the alignment characters {\tt \&}
  3203. determines the position of the tabs.  For example, {\tt \\settabs
  3204. \\+ \\hskip 1 in \& \\hskip 2 in \& \\hskip 1.5 in \& \\cr} would
  3205. set the first tab one inch from the left margin, the next another
  3206. two inches further in, and the third 1.5 inches more.  It's also
  3207. possible to use text to determine the distance between tabs. So,
  3208. for example, another possible sample line is
  3209. {\tt \\settabs \\+ \\quad Province \\quad \& \\quad Population \\quad
  3210. \& \\quad Area \\quad \& \\cr}.
  3211. The tab column would then be just wide enough to accept the headings
  3212. with a quad of space on each side.  Here's a more complete example:
  3213.  
  3214. \beginuser \obeyspaces
  3215. \\settabs \\+ \\quad Year \\quad \& \\quad Price \\quad
  3216.                                             \& \\quad Dividend \& \\cr
  3217. \\+ \\hfill Year \\quad \& \\quad Price  \\quad \& \\quad Dividend \\cr
  3218. \\+ \\hfill 1971 \\quad \& \\quad 41--54 \\quad \& \\qquad \\\$2.60 \\cr
  3219. \\+ \\hfill 2    \\quad \& \\quad 41--54 \\quad \& \\qquad \\\$2.70 \\cr
  3220. \\+ \\hfill 3    \\quad \& \\quad 46--55 \\quad \& \\qquad \\\$2.87 \\cr
  3221. \\+ \\hfill 4    \\quad \& \\quad 40--53 \\quad \& \\qquad \\\$3.24 \\cr
  3222. \\+ \\hfill 5    \\quad \& \\quad 45--52 \\quad \& \\qquad \\\$3.40 \\cr
  3223. \enduser
  3224.  
  3225. \noindent
  3226. gives \TeXref{247}
  3227. \vskip\baselineskip
  3228.  
  3229. \settabs \+ \quad Year \quad & \quad Price \quad & \quad
  3230. Dividend \quad & \cr
  3231. \+ \hfill Year \quad & \quad Price  \quad & \quad Dividend \cr
  3232. \+ \hfill 1971 \quad & \quad 41--54 \quad & \qquad \$2.60   \cr
  3233. \+ \hfill 2    \quad & \quad 41--54 \quad & \qquad \$2.70 \cr
  3234. \+ \hfill 3    \quad & \quad 46--55 \quad & \qquad \$2.87 \cr
  3235. \+ \hfill 4    \quad & \quad 40--53 \quad & \qquad \$3.24 \cr
  3236. \+ \hfill 5    \quad & \quad 45--52 \quad & \qquad \$3.40 \cr
  3237.  
  3238. \exercise Take the table given above and move it closer to the
  3239. \centre{} of the page.
  3240.  
  3241. \exercise One way to \centre{} a block of text, possibly several
  3242. lines long, is to use: {\tt \$\$\\vbox\lb$\ldots$\rb\$\$}. Use
  3243. this to \centre{} the table given above.  Does the
  3244. {\tt \\settabs} line need to be included in the {\tt \\vbox}?
  3245.  
  3246. \exercise Improve your last result by putting a line under the
  3247. column heads.  The control word {\tt \\hrule} will insert a
  3248. horizontal line if introduced between two rows of a table.  Now
  3249. repeat with the control word {\tt \\strut} after the {\tt \\+ }
  3250. of the line containing the column heads. (A {\tt \\strut}
  3251. effectively makes the spacing between lines a little greater. The
  3252. size can be altered from the default.)\TeXref{82} Note the extra
  3253. space that results.
  3254. \toindex{strut}
  3255.  
  3256. \exercise Make the following table with decimal alignment, that
  3257. is, with the decimal points above each other (think of the dollar
  3258. figure as being right aligned and the cents figure as being left
  3259. aligned against the decimal point):
  3260. \medskip
  3261. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  3262. \+ &Plums &\hfill\$1&.22 \cr
  3263. \+ &Coffee &\hfill1&.78 \cr
  3264. \+ &Granola &\hfill1&.98 \cr
  3265. \+ &Mushrooms & &.63 \cr
  3266. \+ &{Kiwi fruit} & &.39 \cr
  3267. \+ &{Orange juice} &\hfill1&.09 \cr
  3268. \+ &Tuna &\hfill1&.29 \cr
  3269. \+ &Zucchini & &.64 \cr
  3270. \+ &Grapes &\hfill1&.69 \cr
  3271. \+ &{Smoked beef} & &.75 \cr
  3272. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  3273. \+ &Total &\hfill \$12&.55 \cr
  3274.  
  3275.  
  3276. \exercise Devise a method to make a rough table of contents by using
  3277. {\tt \\settabs} and having entries looking something like:\hfil\break
  3278. \leftline{\tt Getting Started \\dotfill \& \\hfill 1}
  3279. \leftline{\tt All Characters Great and Small \\dotfill \& \\hfill 9.}
  3280.  
  3281. \subsection{Horizontal alignment with more sophisticated patterns}
  3282.  
  3283. The {\tt \\settabs} environment is not difficult to use, and once
  3284. the pattern is set, it can be used repeatedly in different
  3285. portions of the text that follows.  It does have some drawbacks,
  3286. however. For one, the column size must be set before the entries
  3287. are known. Also, even though in one case we wanted the third
  3288. column to be boldface, it had to be specified in each line.
  3289. These problems can be handled more easily by using the {\tt
  3290. \\halign} environment.
  3291. \TeXref{235--238}
  3292. \toindex{halign}
  3293.  
  3294.  
  3295. The general pattern in the {\tt \\halign} is as follows:
  3296. \beginuser
  3297. \\halign\lb{} <template line> \\cr
  3298. <first display line> \\cr
  3299. <second display line> \\cr
  3300. $\vdots$
  3301. <last display line> \\cr
  3302. \rb
  3303. \enduser
  3304.  
  3305. Both the template line and the display lines are divided into
  3306. sections by the alignment symbol {\tt \&}\null. In the template
  3307. line each section uses control words in the same manner as does
  3308. {\tt \\line\lb\rb}\null.  The control word {\tt \\hfil}, for
  3309. example, can be used to display flush left, flush right, or \centred.
  3310. Fonts can be changed using {\tt \\bf}, {\tt \\it}, etc.
  3311. Text may also be entered in the template line.  In addition the
  3312. special symbol {\tt \#} must appear once in each section.  Each
  3313. display line is then set by substituting each section of the
  3314. display line into its corresponding section of the template line
  3315. at the occurrence of the {\tt \#}\null.
  3316.  
  3317. Consider the following example:
  3318.  
  3319. \beginuser
  3320. \\halign\lb\\hskip 2 in \$\#\$\& \\hfil \\quad \# \\hfil \& \\qquad \$\#\$
  3321.        \hskip 3in \& \\hfil \\quad \# \\hfil \\cr
  3322. \\alpha   \& alpha   \& \\beta  \& beta  \\cr
  3323. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3324. \\epsilon \& epsilon \& \\zeta  \& zeta  \\cr
  3325. \rb
  3326. \enduser
  3327.  
  3328. \noindent The template line indicates that the first section of
  3329. the typeset text will always be set two inches in from the left
  3330. and also be set as mathematics.  The second section will be \centred{}
  3331. after adding a quad of space on the left.  The third
  3332. and fourth sections are handled similarly.  Here is the result:
  3333. \vskip\baselineskip
  3334.  
  3335. \halign{\hskip 2in $#$& \hfil\quad # \hfil & \qquad $#$
  3336.                        & \hfil\quad # \hfil\cr
  3337. \alpha   & alpha   & \beta  & beta \cr
  3338. \gamma   & gamma   & \delta & delta \cr
  3339. \epsilon & epsilon & \zeta  & zeta \cr
  3340. }
  3341.  
  3342. In this case the first display line is formed by substituting {\tt
  3343. \\alpha} for the first {\tt \#} in the template line, {\tt alpha} for
  3344. the second {\tt \#}, {\tt \\beta} for the third and {\tt beta} for
  3345. the fourth.  The whole line is then saved for setting.  This
  3346. continues until all the lines are accumulated, and then they are set
  3347. with each column being as wide as necessary to accept all of its
  3348. entries (an implication of this accumulation process is that a table
  3349. with too many entries could cause \TeX{} to run out of memory; it's
  3350. better not to set tables that are more than a page or so long).
  3351.  
  3352. Hence the template line establishes the pattern for the table entries
  3353. and the display lines insert the individual entries.
  3354.  
  3355. Sometimes horizontal and vertical lines are used to delimit
  3356. entries in a table.  To put in horizontal lines, we use {\tt \\hrule},
  3357. just as we did in the {\tt \\settabs} environment.
  3358. However, we don't want the rule to be aligned according to the
  3359. template, so we use the control word {\tt \\noalign}.  Hence
  3360. horizontal lines are inserted by putting {\tt \\noalign\lb\\hrule\rb};
  3361. vertical lines are inserted by putting {\tt \\vrule}
  3362. in either the template or the display line. But still all is not
  3363. completely straightforward.  Suppose we take our last example and
  3364. change the template to get vertical lines and also insert
  3365. horizontal lines.
  3366. \toindex{noalign}
  3367.  
  3368. \beginuser
  3369. \\halign\lb\\hskip 2in\\vrule\\quad \$\#\$\\quad \& \\vrule \\hfil\\quad %
  3370. \# \\hfil
  3371. \hskip 2 in \& \\quad \\vrule \\quad \$\#\$\\quad
  3372. \hskip 2 in \& \\vrule\\hfil \\quad \# \\quad \\hfil \\vrule \\cr
  3373. \\noalign\lb\\hrule\rb
  3374. \\alpha   \& alpha   \& \\beta  \& beta \\cr
  3375. \\noalign\lb\\hrule\rb
  3376. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3377. \\noalign\lb\\hrule\rb
  3378. \\epsilon \& epsilon \& \\zeta  \& zeta \\cr
  3379. \\noalign\lb\\hrule\rb
  3380. \rb
  3381. \enduser
  3382.  
  3383. \noindent
  3384. doesn't give exactly what we want.
  3385.  
  3386. \vskip\baselineskip
  3387.  
  3388. \halign{\hskip 2in\vrule\quad $#$\quad & \vrule \hfil\quad # \hfil
  3389. & \quad \vrule \quad $#$\quad & \vrule \hfil\quad # \quad \hfil
  3390. \vrule \cr
  3391. \noalign{\hrule}
  3392. \alpha   & alpha   & \beta  & beta \cr
  3393. \noalign{\hrule}
  3394. \gamma   & gamma   & \delta & delta \cr
  3395. \noalign{\hrule}
  3396. \epsilon & epsilon & \zeta  & zeta \cr
  3397. \noalign{\hrule}
  3398. }
  3399.  
  3400. There are several deficiencies: the most obvious is the extended
  3401. horizontal lines, but also the text looks somewhat squashed into
  3402. the boxes.  In addition, the text has a little extra space on the
  3403. right rather than being perfectly \centred. As in the {\tt \\settabs}
  3404. environment, lines can be made taller by including the control
  3405. word {\tt \\strut} in the template.\TeXref{82} A further problem
  3406. can occur when the page is set since \TeX{} may spread lines
  3407. apart slightly to improve the appearance of the page.  This would
  3408. leave a gap between the vertical lines, so we use the control
  3409. word {\tt \\offinterlineskip} within the {\tt \\halign} to avoid
  3410. this.  Finally we can get rid of the lines sticking out on the
  3411. left by deleting the {\tt \\hskip 2 in} from the template line.
  3412. To move the table to the same position we use {\tt \\moveright}.
  3413. Finally, we can see how to \centre{} the text by noting that the
  3414. extra space occurs in the template line after the {\tt \#} where
  3415. the text is inserted.
  3416. Hence we can improve our result by using
  3417. \toindex{offinterlineskip}
  3418. \toindex{moveright}
  3419.  
  3420. \beginuser
  3421. \\moveright 2 in
  3422. \\vbox\lb\\offinterlineskip
  3423.  
  3424. \\halign\lb\\strut \\vrule \\quad \$\#\$\\quad \&\\vrule \\hfil \\quad %
  3425. \#\\quad \\hfil
  3426. \&\\vrule \\quad \$\#\$\\quad \&\\vrule \\hfil \\quad \#\\quad \\hfil %
  3427. \\vrule \\cr
  3428. \\noalign\lb\\hrule\rb
  3429. \\alpha   \& alpha   \& \\beta  \& beta \\cr
  3430. \\noalign\lb\\hrule\rb
  3431. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3432. \\noalign\lb\\hrule\rb
  3433. \\epsilon \& epsilon \& \\zeta  \& zeta \\cr
  3434. \\noalign\lb\\hrule\rb
  3435. \rb\rb
  3436. \enduser
  3437.  
  3438. \noindent
  3439. to get
  3440. \vskip\baselineskip
  3441.  
  3442. \moveright 2 in
  3443. \vbox{\offinterlineskip
  3444. \halign{\strut \vrule \quad $#$\quad &\vrule \hfil \quad #\quad \hfil
  3445. &\vrule \quad $#$\quad &\vrule \hfil \quad #\quad \hfil
  3446. \vrule \cr
  3447. \noalign{\hrule}
  3448. \alpha   & alpha   & \beta  & beta \cr
  3449. \noalign{\hrule}
  3450. \gamma   & gamma   & \delta & delta \cr
  3451. \noalign{\hrule}
  3452. \epsilon & epsilon & \zeta  & zeta \cr
  3453. \noalign{\hrule}
  3454. }
  3455. }
  3456.  
  3457.  
  3458.  
  3459. In general, if we want to construct a table with boxed entries
  3460. that is \centred{} on the page, we can do so by putting the {\tt
  3461. \\vbox} within a {\tt \\centerline\lb\rb}\null. But here is a
  3462. trick that will produce a nicer result.  If the {\tt \\vbox} is
  3463. put in between double dollar signs, it will be typeset as
  3464. displayed mathematics.  Of course, there is no actual
  3465. mathematics being displayed, but \TeX{} will put in a little
  3466. extra space above and below the table as is appropriate for a
  3467. display.  Hence a \centred{} table with this nice spacing may be
  3468. formed using the following four steps:
  3469. (1) put a {\tt \\vbox} between double dollar signs,
  3470. (2) put an {\tt \\offinterlineskip} and an {\tt \\halign} within
  3471. the {\tt \\vbox},
  3472. (3) in the {\tt \\halign} put a template line with a {\tt \\strut}
  3473. in the beginning,  and a {\tt \\vrule} surrounding each entry,
  3474. (4) each row of the table should be preceded and followed by
  3475. {\tt \\noalign\lb\\hrule\rb}.
  3476.  
  3477. Here is the pattern to be followed:
  3478.  
  3479. \beginuser
  3480. \$\$\\vbox\lb
  3481. \\offinterlineskip
  3482. \\halign\lb
  3483. \\strut \\vrule \# \& \\vrule \# \& \dots \& \\vrule \# \\vrule \\cr
  3484. \\noalign\lb\\hrule\rb
  3485. <first column entry> \& <second column entry> \& \dots %
  3486. \& <last column entry> \\cr
  3487. \\noalign\lb\\hrule\rb
  3488. \dots
  3489. \\noalign\lb\\hrule\rb
  3490. <first column entry> \& <second column entry> \& \dots %
  3491. \& <last column entry> \\cr
  3492. \\noalign\lb\\hrule\rb
  3493. \rb
  3494. \rb\$\$
  3495. \enduser
  3496.  
  3497.  
  3498.  
  3499. \section{Rolling your own}
  3500.  
  3501. In this section we'll create new control words.  The making of
  3502. these new definitions, also called macros, is one of the most
  3503. powerful techniques available in \TeX\null.  For the first
  3504. application of this facility, we'll see how a new definition can
  3505. save a lot of typing by substituting short strings for long ones.
  3506.  
  3507. \subsection{The long and short of it}
  3508.  
  3509. The control word {\tt \\def} is used to define new control words.
  3510. The simplest form for doing this is {\tt \\def\\newname\lb$\ldots$\rb}.
  3511. Then whenever {\tt \\newname} appears in your
  3512. input file, it will be replaced by whatever is between the braces
  3513. in the definition.  Of course {\tt \\newname} must satisfy the
  3514. convention for naming control sequences, that is, it must be a
  3515. control word (all letters) or a control symbol (exactly one
  3516. nonletter). So, for example, suppose you write a document that
  3517. contains the phrase ``University of Manitoba'' many times.  Then
  3518. {\tt \\def\\um\lb University of Manitoba\rb} defines a new
  3519. control sequence {\tt \\um} which can then be used at any time.
  3520. The sentence {\tt I take courses at the \\um.}\ then makes
  3521. sense. If the control word exists, your new definition will
  3522. replace it (this includes the control words defined by \TeX{}, so
  3523. a little care must be taken in the choice of name). Any
  3524. definition is, however,  local to the group in which it is
  3525. defined.  For example, \toindex{def}
  3526.  
  3527. \beginuser
  3528. \\def\\um\lb University of Manitoba\rb
  3529. I took my first course at the \\um.
  3530. \lb
  3531. \\def\\um\lb Universit\\'e de Montr\\'eal\rb
  3532. Then I took my next course at the \\um.
  3533. \rb
  3534. Finally I took my last course at the \\um.
  3535. \enduser
  3536.  
  3537. \noindent gives \medskip
  3538.  
  3539. \def\um{University of Manitoba}
  3540. I took my first course at the \um.
  3541. {
  3542. \def\um{Universit\'e de Montr\'eal}
  3543. Then I took my next course at the \um.
  3544. }
  3545. Finally I took my last course at the \um.
  3546.  
  3547. Remember that all spaces after a control word are absorbed; this
  3548. includes the control words that you define. In the previous
  3549. example, any space after {\tt \\um} would be ignored. However,
  3550. the space after the first period and the space after the first
  3551. opening brace are different; if you look closely at the end of
  3552. the first sentence typeset using the example, you'll see some
  3553. extra space. This can be eliminated by putting a {\tt \%} after
  3554. the opening brace to make the rest of the line a comment. The
  3555. same holds for the line with the last closing brace. Careful
  3556. control of spaces often calls for the ``commenting out'' of the
  3557. end of lines in this manner.
  3558.  
  3559. Once a new control sequence has been defined, it may be used in
  3560. new definitions. This is one way of making simple form letters.
  3561. First let's define a simple letter.
  3562.  
  3563. \beginuser
  3564. \\def\\letter\lb
  3565. \\par \\noindent
  3566. Dear \\name,
  3567. \
  3568. This is a little note to let you know that your name is \\name.
  3569. \
  3570. \\hskip 2 in Sincerely yours,
  3571. \\vskip 2\\baselineskip
  3572. \\hskip 2 in The NameNoter
  3573. \\smallskip \\hrule
  3574. \rb
  3575. \enduser
  3576.  
  3577. \def\letter{
  3578. \par \noindent
  3579. Dear \name,
  3580.  
  3581. This is a little note to let you know that your name is \name.
  3582.  
  3583. \hskip 2 in Sincerely yours,
  3584. \vskip 2\baselineskip\nobreak
  3585. \hskip 2 in The NameNoter
  3586. \smallskip \hrule
  3587. }
  3588.  
  3589. Now this letter uses the control word {\tt \\name}, which is
  3590. undefined at this point.  When {\tt \\letter} is used, the
  3591. current value of {\tt \\name} will appear in the body of the
  3592. letter. Hence
  3593.  
  3594. \beginuser
  3595. \\def\\name\lb Michael Bishop\rb
  3596. \\letter
  3597. \\def\\name\lb Michelle L\\'ev\\\^{}eque\rb
  3598. \\letter
  3599. \enduser
  3600.  
  3601. \noindent will produce two copies of the letter, each with the
  3602. correct name, followed by a horizontal rule:
  3603.  
  3604. \def\name{Michael Bishop}
  3605. \letter
  3606. \goodbreak
  3607. \def\name{Michelle L\'ev\^eque}
  3608. \letter
  3609.  
  3610. We could have put anything between the braces in
  3611. {\tt \\def\\name\lb$\ldots$\rb}; it could be several paragraphs
  3612. long and use other control sequences (although in this context it
  3613. would be a little strange). Of course it is possible to use {\tt
  3614. \\vfill \\eject} as part of the definition of {\tt \\letter} to
  3615. eject the page when the letter is completed.
  3616.  
  3617. \exercise Make a form letter that uses the control words {\tt \\name},
  3618. {\tt \\address}, {\tt \\city}, {\tt \\\province}, and {\tt
  3619. \\\postcode}.
  3620.  
  3621. \exercise An unnumbered list of items is often made
  3622. using {\tt \\item\lb\$\\bullet\$\rb}.  Define a macro {\tt \\bitem}
  3623. that does this, and use it for several paragraphs. Now change
  3624. each bullet to a dash (note that a simple change in the macro
  3625. propagates all the necessary changes in all of the paragraphs).
  3626.  
  3627. \exercise Suppose that you are going to have to format several
  3628. paragraphs in a paper using {\tt \\hangindent = 30 pt}, {\tt \\hangafter
  3629. = 4}, and {\tt \\filbreak} (don't worry about what
  3630. these control sequences actually do; the only important thing
  3631. for now is that once they are set, they remain in effect for only
  3632. one paragraph).  Define a single control sequence {\tt \\setpar}
  3633. which can then be put in front of each paragraph that needs to be
  3634. so formatted.
  3635.  
  3636.  
  3637. \subsection{Filling in with parameters}
  3638.  
  3639. It's possible to use macros in much greater generality by
  3640. allowing parameters to be passed.  The idea is somewhat similar
  3641. to the template line in the {\tt \\halign} environment.  First,
  3642. let's look at the case where there is one parameter.  In this
  3643. case a control sequence is defined by {\tt \\def\\newword\#1\lb
  3644. $\ldots$\rb}\null.  The symbol {\tt \#1} may appear between the
  3645. braces (several times) in the definition of {\tt \\newword}.  The
  3646. material between the braces acts like a template. When {\tt
  3647. \\newword\lb$\ldots$\rb} appears in the text, it will use the
  3648. definition of {\tt \\newword} with the material between the
  3649. braces inserted into the template at every occurrence of {\tt
  3650. \#1} in the original definition. {\bf The spacing in the original
  3651. definition is crucial here; there must be no spaces before the
  3652. opening brace}.
  3653.  
  3654. As an example, we could use the form letter of the last section in
  3655. the following way:
  3656.  
  3657.  
  3658. \beginuser
  3659. \\def\\letter\#1\lb
  3660. \\par \\noindent
  3661. Dear \#1,
  3662. \vskip\baselineskip
  3663. This is a little note to let you know that your name is \#1.
  3664. \vskip\baselineskip
  3665. \\hskip 2 in Sincerely yours,
  3666. \\vskip 2\\baselineskip
  3667. \\hskip 2 in The NameNoter
  3668. \\smallskip \\hrule
  3669. \rb
  3670. \enduser
  3671.  
  3672. \def\letter#1{
  3673. \par \noindent
  3674. Dear #1,
  3675.  
  3676. This is a little note to let you know that your name is #1.
  3677.  
  3678. \hskip 2 in Sincerely yours,
  3679. \vskip 2\baselineskip
  3680. \hskip 2 in The NameNoter
  3681. \smallskip \hrule
  3682. }
  3683.  
  3684. Now we can use
  3685.  
  3686. \beginuser
  3687. \\letter\lb Michael Bishop\rb
  3688. \\letter\lb Michelle L\\'ev\\\^{}eque\rb
  3689. \enduser
  3690.  
  3691. \noindent to get \medskip
  3692. \letter{Michael Bishop}
  3693. \goodbreak
  3694. \letter{Michelle L\'ev\^eque}
  3695.  
  3696. \def\displaytext#1{$$\vbox{\hsize=12cm #1}$$}
  3697. \bigskip
  3698. \displaytext{
  3699. Now let's define
  3700. {\tt\\def\\displaytext\#1\lb \$\$\\vbox\lb\\hsize = 12 cm \#1\rb\$\$\rb}
  3701. as a new macro to display text.
  3702. Then {\tt \\displaytext\lb$\ldots$\rb} will cause the material
  3703. between the braces to be put in a paragraph with width 12 \centimetre
  3704. s and then \centred{} with some space added above and
  3705. below as is appropriate for a display.  This paragraph was set
  3706. using this {\tt \\displaytext} macro.
  3707. }
  3708.  
  3709. The parameter of a macro can be no more than one paragraph long.
  3710. If a new paragraph is encountered as part of a parameter, an
  3711. error will be generated.  This is a safety feature, for
  3712. otherwise the accidental omission of a closing brace would cause
  3713. \TeX{} to eat up the rest of the file as the parameter.
  3714.  
  3715. \exercise Define a macro {\tt \\yourgrade} so that {\tt
  3716. \\yourgrade\lb89\rb} will cause the following sentence to be
  3717. typeset: The grade you received is 89\%\null. It should be able
  3718. to work with any other percentage, of course.
  3719. \medbreak
  3720.  
  3721. It's not really any harder to use more than one parameter.  The form
  3722. used to define a new control word with two parameters is
  3723. {\tt \\def\\newword\#1\#2\lb$\ldots$\rb}. The definition between the
  3724. braces may have {\tt \#1} and {\tt \#2} occurring in it, perhaps
  3725. several times.  When {\tt \\newword\lb$\ldots$\rb\lb$\ldots$\rb}
  3726. appears in the text, the material between the first set of braces
  3727. replaces {\tt \#1} in the definition and the material between the
  3728. second set of braces replaces {\tt \#2} in the definition.  Here is
  3729. an example followed by its result:
  3730.  
  3731. \beginuser
  3732. \\def\\talks\#1\#2\lb \#1 talks to \#2.\rb
  3733. \\talks\lb John\rb\lb Jane\rb
  3734. \\talks\lb Jane\rb\lb John\rb
  3735. \\talks\lb John\rb\lb me\rb
  3736. \\talks\lb She\rb\lb Jane\rb
  3737. \enduser
  3738.  
  3739. \def\talks#1#2{#1 talks to #2.}
  3740. \talks{John}{Jane}
  3741. \talks{Jane}{John}
  3742. \talks{John}{me}
  3743. \talks{She}{Jane}
  3744.  
  3745. \exercise In a manner similar to the previous exercise, define a
  3746. macro {\tt \\yourgrade} so that {\tt \\yourgrade\lb89\rb\lb85\rb}
  3747. causes the following sentence to be typeset: You received a grade
  3748. of 89\% on your first exam and a grade of 85\% on your second
  3749. exam.
  3750.  
  3751. \exercise Write a macro {\tt \\frac} so that {\tt \\frac\lb
  3752. a\rb\lb b\rb} will typeset the fraction ${a\over b}$.
  3753.  
  3754. \bigskip
  3755. It's important not to put any spaces before the first brace in
  3756. the definition. If you do, \TeX{} will interpret the definition
  3757. differently from the way described here. For more than two
  3758. parameters, the method of definition is similar. To define a
  3759. control word with three parameters, start with
  3760. {\tt \\def\\newword\#1\#2\#3\lb$\ldots$\rb}. Then {\tt \#1},
  3761. {\tt \#2} and {\tt \#3} may occur between the braces. When
  3762. {\tt \\newword\lb$\ldots$\rb\lb$\ldots$\rb\lb$\ldots$\rb}
  3763. appears in the text, the material between each set of braces
  3764. replaces its corresponding symbol in the definition of the
  3765. control word. The parameters may go up to {\tt \#9}.
  3766.  
  3767. \subsection{By any other name}
  3768.  
  3769. Sometimes it's convenient to be able to give a control word an
  3770. alternative name.  For example, if you prefer a different spelling,
  3771. you might want to call the control word {\tt \\centerline} by the
  3772. name of {\tt \\centreline}.  This can be done by using the {\tt
  3773. \\let} control word.  The use of {\tt \\let \\centreline =
  3774. \\centerline} now makes a new (as well as the old) control word
  3775. available.  This can also be used with mathematical names as with
  3776. {\tt \\let \\tensor = \\otimes}.  It is then possible to use
  3777. \TeXref{206--207}
  3778.  
  3779. \toindex{let}
  3780. \toindex{centreline}
  3781. \toindex{tensor}
  3782.  
  3783. \let\tensor=\otimes
  3784. \beginuser
  3785. \$\$ (A \\tensor B) (C \\tensor D) = AC \\tensor BD. \$\$
  3786. \enduser
  3787.  
  3788. \noindent to get
  3789.  
  3790. $$ (A \tensor B) (C \tensor D) = AC \tensor BD. $$
  3791.  
  3792.  
  3793.  
  3794. \exercise Define control sequences {\tt \\ll}, {\tt \\cl}, and
  3795. {\tt \\rl} that are equivalent to {\tt \\leftline}, {\tt \\centerline},
  3796. and {\tt \\rightline}.
  3797.  
  3798. The {\tt \\let} control word allows users to name their own
  3799. control sequences.  This allows a personalized set of control
  3800. sequences that may be used in place of the ones provided by \TeX{}
  3801. when desired.
  3802.  
  3803. \section{To err is human}
  3804.  
  3805. In some ways \TeX{} is not completely divine. \TeX{} will respond
  3806. to invalid input by giving an error message to the screen if you
  3807. are using it interactively and also to the log file.  Because
  3808. \TeX{} is very complicated, the actual point where the error is
  3809. detected may be deep within the program, so a full report of the
  3810. error may be rather long and involved.    Not only that, \TeX{}
  3811. will try to recover from errors, and will report what was done in
  3812. that process.  For this reason the reading of error messages may
  3813. be a little difficult for the uninitiated.  The key is to know
  3814. what is important from your perspective and what can be safely
  3815. ignored. So let's look at some typical errors and the messages
  3816. that they generate.
  3817.  
  3818. \subsection{The forgotten bye}
  3819.  
  3820. The first mistake that we'll look at is one that everyone makes
  3821. at some time, namely, the omission of {\tt \\bye} at the end of
  3822. the file. If you're using \TeX{} interactively, an asterisk \hfil
  3823. \break
  3824. \leftline{\tt *}
  3825. will be printed on the screen and nothing will happen since,
  3826. having not been told to finish up,  \TeX{} is waiting for input
  3827. (from your keyboard).  Whatever you type in will be appended to
  3828. whatever has been input from your files.  The usual response is
  3829. to type {\tt \\bye<CR>}\fnote{{\tt <CR>} is the key
  3830. used to end a line of input.  It might be called the carriage
  3831. return, enter, or simply the return key on your terminal.
  3832. Sometimes it is indicated by a large left arrow.} since that will
  3833. finish things up.
  3834.  
  3835. \subsection{The misspelled or unknown control sequence}
  3836.  
  3837. Using a misspelled or other control sequence unknown to \TeX{} is
  3838. a common error.  If \TeX{} is being run as a batch job, an error
  3839. message is printed and the job goes on ignoring the control
  3840. sequence.  When using \TeX{} interactively, it is possible to
  3841. repair errors (of course this does not change the original input
  3842. file, so that must be done when the \TeX{} job is completed).
  3843. Suppose we have a \TeX{} input file consisting of the following
  3844. two lines:
  3845. \beginuser
  3846. \\line\lb The left side \\hfli the right side\rb
  3847. \\bye
  3848. \enduser
  3849.  
  3850. The control word should be {\tt \\hfil}, of course. Here is the
  3851. message that would be sent to your terminal:
  3852.  
  3853. \beginuser
  3854. \obeyspaces
  3855. ! Undefined  control sequence.
  3856. l.1 \\line\lb The left side \\hfli
  3857. \                               the right side\rb
  3858. ?
  3859. \enduser
  3860.  
  3861. The first line starts with {\tt !} and gives the error message.
  3862. Next comes the line number on which the error occurred and the
  3863. part of the line that was read successfully.  The next line gives
  3864. the continuation of the line after the error. At this point the
  3865. question mark means that \TeX{} is waiting for a response.  There
  3866. are several legal ones:
  3867. \nobreak
  3868. \maketable [Responses to \TeX{} error messages]
  3869. \halign{
  3870. \strut \hfil # \hfil & \quad \hfil \tt # \hfil & # \hfil\cr
  3871.    \bf Desired response & \bf Input to \TeX{} & \bf \hfil Result\cr
  3872.    \noalign{\hrule} \noalign{\smallskip}
  3873.    Help   & h<CR>& Reason for stopping listed on terminal.\cr
  3874.    Insert & i<CR>& Next line inserted into \TeX{} input file.\cr
  3875.    Exit   & x<CR>& Exit from \TeX\null. Completed pages to DVI file.\cr
  3876.    Scroll & s<CR>& List message and continue after minor errors.\cr
  3877.    Run    & r<CR>& List message and continue after any errors.\cr
  3878.    Quiet  & q<CR>& All terminal listings suppressed.\cr
  3879.    Carry on &<CR> & \TeX{} continues as best it can.\cr
  3880.       }
  3881.  
  3882. In our last example a reasonable response might be to enter {\tt
  3883. h<CR>} to get a help message, then {\tt i<CR>} to insert more
  3884. text, (at which point \TeX{} responds with {\tt insert> } and
  3885. finally {\tt \\hfil} as the correct control word.  Here is the
  3886. result:
  3887.  
  3888.  
  3889. \beginuser
  3890. ? h <CR>
  3891. The control sequence at the end of the top line
  3892. of your error message was never \\def'ed. If you have
  3893. misspelled it (e.g., `\\hobx'), type `I' and the correct
  3894. spelling (e.g., `I\\hbox'). Otherwise just continue,
  3895. and I'll forget about whatever was undefined.
  3896.  
  3897. ? i <CR>
  3898. insert>\\hfil
  3899. [1]
  3900. \enduser
  3901.  
  3902. The final {\tt [1]} means that the first (and only) page has
  3903. been completed and sent to the DVI file.  The original input file
  3904. still needs to be fixed, of course.
  3905.  
  3906. \subsection{The misnamed font}
  3907.  
  3908. A misspelled font name is an error similar to the misspelled
  3909. control sequence.  The error message is different and a little
  3910. confusing at first. Suppose for example the following appears in
  3911. your input file:
  3912.  
  3913. \leftline{\tt \\font\\sf = cmss01}
  3914.  
  3915. It should be {\tt cmss10}, that is, the numbers have been
  3916. transposed.  Here are the error and help messages:
  3917.  
  3918. \beginuser \obeyspaces
  3919. ! Font \\sf=cmss01 not loadable: Metric (TFM) file not found.
  3920. <to be read again>
  3921. \                   \\par
  3922. \\bye ->\\par
  3923. \            \\vfill \\supereject \\end
  3924. l.2 \\bye
  3925.  
  3926. ? h <CR>
  3927. I wasn't able to read the size data for this font,
  3928. so I will ignore the font specification.
  3929. [Wizards can fix TFM files using TFtoPL/PLtoTF.]
  3930. You might try inserting a different font spec;
  3931. e.g., type `I\\font<same font id>=<substitute font name>'.
  3932. \enduser
  3933.  
  3934. The TFM (\TeX{} font metric) file is an auxiliary file that is
  3935. used by \TeX\null. So this strange message is just telling you
  3936. that the font you defined doesn't exist on your computer system.
  3937.  
  3938. \subsection{Mismatched mathematics}
  3939.  
  3940. Another common error is to use {\tt \$} or {\tt \$\$} to start a
  3941. mathematical expression and then to forget the second {\tt \$}
  3942. or {\tt \$\$} when finished.  The text that follows is then
  3943. treated as mathematics, and to make matters worse, if more
  3944. mathematics is started by a new {\tt \$} or {\tt \$\$}, it will
  3945. then be treated as ordinary text.  Needless to say, error
  3946. messages galore may be generated. \TeX{} will attempt to correct
  3947. the problem by inserting a new {\tt \$} or {\tt \$\$}; in any
  3948. case, the problem is corrected by the end of the paragraph since
  3949. a new paragraph will automatically start as ordinary text.
  3950.  
  3951. Consider the following correct input and its output:
  3952. \beginuser
  3953. Since \$f(x) > 0\$, \$a<b\$,  and \$f(x)\$ is continuous, we know that
  3954. \$\\int\_{}a\^{}b f(x)\\,dx >0\$.
  3955. \enduser
  3956.  
  3957. Since $f(x) > 0$, $a<b$,  and $f(x)$ is continuous, we know that
  3958. $\int_a^b f(x)\,dx >0$.
  3959.  
  3960. If we now leave out the second dollar sign in {\tt \$f(x)\$} we
  3961. then get the following error and help messages:
  3962.  
  3963. \beginuser \obeyspaces
  3964. ! Missing \$ inserted.
  3965. <inserted text>
  3966. \               \$
  3967. <to be read again>
  3968. \                  \\intop
  3969. \\int ->\\intop
  3970. \             \\nolimits
  3971. l.2 \$\\int
  3972. \          \_{}a\^{}b f(x)\\,dx >0\$.
  3973. ? h <CR>
  3974. I've inserted a begin-math/end-math symbol since I think
  3975. you left one out. Proceed, with fingers crossed.
  3976.  
  3977. ?
  3978. \enduser
  3979.  
  3980. The line starting with {\tt !} tells us what has been done. The
  3981. line starting with {\tt l.2} shows us where we were in the input
  3982. file when the error occurred.  As in our other examples, the part
  3983. of the line successfully read, that is, through {\tt \\int},
  3984. appears on one line, and the continuation appears on the next
  3985. line. The remaining material may seem somewhat obscure.  These
  3986. intermediate messages show what was happening further in the guts
  3987. of the \TeX{} program when the error occurred.  The newer user
  3988. may ignore them.
  3989.  
  3990. Here is what you get as output after \TeX{} tries to recover from
  3991. the error.
  3992.  
  3993. Since $f(x) > 0$, $a<b$,  and $f(x) is continuous, we know that
  3994. \int_a^b f(x)\,dx >0$.
  3995.  
  3996. There is a stretch of text that is italic with no spacing.  This
  3997. is typical for normal text being processed as mathematics; if you
  3998. see this in your output, you have almost certainly left out a
  3999. {\tt \$} or {\tt \$\$}.
  4000.  
  4001. \subsection{Mismatched braces}
  4002.  
  4003. It's easy to forget or mismatch the closing braces when making
  4004. groups.  The result may be a relatively benign error, or it may
  4005. be catastrophic. Suppose, for example, you have {\tt \lb\\bf A
  4006. bold title } in your text with the closing right brace omitted.
  4007. The result will be the same as if no opening brace were there;
  4008. that is, the rest of the paper will be boldface if no other font
  4009. changes are made.  You will get the following message at the end
  4010. of the file:
  4011.  
  4012. {\tt (\\end occurred inside a group at level 1)}
  4013.  
  4014. If you had made the same mistake twice, then there would be two
  4015. more opening braces than closing braces, and you would get the
  4016. message:
  4017.  
  4018. {\tt (\\end occurred inside a group at level 2)}
  4019.  
  4020. \TeX{} doesn't know that the closing brace is missing until it
  4021. reaches the end of the input file.  Hence the message doesn't
  4022. tell you where you went wrong.  If the location of the missing
  4023. brace isn't obvious, it's always possible to insert {\tt \\bye}
  4024. halfway through your document.  Running \TeX{} again will cause
  4025. only the first half to be processed, and if the error message
  4026. persists, you will know that the error is in the first half of
  4027. the document.  By moving the {\tt \\bye} to different places, the
  4028. error can be localized.  Also, looking at the output often
  4029. reveals what has gone wrong.
  4030.  
  4031. Missing opening braces are much easier to spot.  Here is a two
  4032. line input file and the resulting error and help messages:
  4033.  
  4034. \beginuser
  4035. \\bf Here is the start\rb, but there is the finish.
  4036. \\bye
  4037. \enduser
  4038.  
  4039. \beginuser \obeyspaces
  4040. ! Too many \rb's.
  4041. l.1 \\bf Here is the start\rb
  4042. \                          , but there is the finish.
  4043.  
  4044. ? h <CR>
  4045. You've closed more groups than you opened.
  4046. Such booboos are generally harmless, so keep going.
  4047. \enduser
  4048.  
  4049. It's quite possible, of course, that the line that is supposed to
  4050. have the missing left brace will not be on the line where \TeX{}
  4051. catches the error.
  4052.  
  4053. A mismatched brace in the definition of a new control sequence
  4054. can cause a major error.  Since such a definition may include
  4055. several paragraphs, it may not be caught by the end of a
  4056. paragraph, but, rather will just keep piling more and more text
  4057. into the unfinished definition.  It's even possible for \TeX{} to
  4058. run out of memory as it keeps eating up more text! This is called
  4059. a ``runaway definition''.
  4060. \TeXref{206}
  4061. Here is a two line input file with a runaway definition:
  4062.  
  4063. \vbox{
  4064. \beginuser
  4065. \\def\\newword\lb the def
  4066. \\newword
  4067. \\bye
  4068. \enduser
  4069. }
  4070.  
  4071. Here are the resulting error and help messages:
  4072.  
  4073. \beginuser \obeyspaces
  4074. Runaway definition?
  4075. ->the def
  4076. ! Forbidden control sequence found while scanning definition of \\newword.
  4077. <inserted text>
  4078. \                \rb
  4079. <to be read again>
  4080. \                   \\bye
  4081. l.3 \\bye
  4082.  
  4083. ? h <CR>
  4084. I suspect you have forgotten a `\rb', causing me
  4085. to read past where you wanted me to stop.
  4086. I'll try to recover; but if the error is serious,
  4087. you'd better type `E' or `X' now and fix your file.
  4088.  
  4089. ? <CR>
  4090. No pages of output.
  4091. \enduser
  4092.  
  4093. This is obviously a serious error.  If it occurs at the beginning
  4094. of a file (as in the previous example), there will be no output
  4095. at all!
  4096.  
  4097. If a closing brace is left out while using a macro with
  4098. parameters, the runaway definition will be terminated at the end
  4099. of the paragraph. So if {\tt \\def\\newword\#1\lb$\ldots$\rb} has
  4100. been defined and you use {\tt \\newword\lb$\dots$ } without the
  4101. closing brace, then at most one paragraph will be ruined.
  4102. \TeXref{205}
  4103.  
  4104. In short, when an error occurs, make a note of the line number to
  4105. see how much of the input file has been read, and also the line
  4106. starting with an exclamation point to get a short description of
  4107. the error. If the error is still not clear, ask \TeX{} for more
  4108. information by typing {\tt h<CR>}. For small errors, \TeX{} can
  4109. carry on quite a way if you just keep hitting the {\tt <CR>}.
  4110.  
  4111.  
  4112.  
  4113.  
  4114. \section{Digging a little deeper}
  4115.  
  4116. In this section we look at a few topics that allow \TeX{} to be
  4117. used with greater flexibility or efficiency.  As the documents
  4118. being produced get longer, different techniques can help make
  4119. their creation easier.
  4120.  
  4121. \subsection{Big files, little files}
  4122.  
  4123. \TeX{} can read and write files as it runs.  This makes it
  4124. possible to use files that are smaller and more convenient to
  4125. handle by creating a master file that reads the smaller files in
  4126. the proper order. This document, for example, consists of ten
  4127. sections plus an introduction.  In addition, there are macros
  4128. that are used for all sections. The macros can be put in a file
  4129. called, say, {\tt macros.tex}, the introduction can be put in {\tt
  4130. intro.tex}, and each section put in its own file.  The control
  4131. word {\tt \\input} is then used to read in a file.  In general,
  4132. {\tt \\input filename} will cause the file called {\tt
  4133. filename.tex} to be read in and processed immediately, just as if
  4134. the text of {\tt filename.tex} had been part of the file that
  4135. read it in.  This file may input other files. In fact it's often
  4136. convenient to make a single file that reads in smaller pieces,
  4137. perhaps as follows:
  4138. \toindex{input}
  4139.  
  4140. \beginuser
  4141. \\input macros
  4142. \\input intro
  4143. \\input sec1
  4144. \\input sec2
  4145. \\input sec3
  4146. \\input sec4
  4147. \\input sec5
  4148. \\input sec6
  4149. \\input sec7
  4150. \\input sec8
  4151. \\input sec9
  4152. \\input sec10
  4153. \enduser
  4154.  
  4155. While the text is still being heavily edited, it's possible to
  4156. process only some of the files by putting a {\tt \%} at the
  4157. beginning of each line that contains a file to be skipped (this
  4158. is sometimes called ``commenting out'' the unwanted files).
  4159.  
  4160. The {\tt \\input} control word also allows the use of
  4161. predesigned macros.  The macros for a memorandum, for example,
  4162. might be put in a file called {\tt memo.tex}.  These macros might
  4163. set up the right {\tt \\hsize}, {\tt \\vsize} and other
  4164. parameters, and might stamp the time and date.  Once this has
  4165. been set up, all memoranda may be started with {\tt \\input memo}
  4166. to make them come out with a common format.
  4167.  
  4168. Be sure that you don't have the control word {\tt \\bye} in your
  4169. input file or the \TeX{} program will stop at that point.
  4170.  
  4171. \exercise Make a \TeX{} input file that reads in a second file.
  4172. Try reading in the second file twice using the {\tt \\input}
  4173. control word twice.
  4174.  
  4175. \subsection{Larger macro packages}
  4176.  
  4177. Designing macros that can be used with many types of documents
  4178. is obviously useful.  Most universities, for example, have
  4179. specific and often complicated format requirements for theses.  A
  4180. collection of macros, that is, a macro package that meets all
  4181. these specifications could be somewhat time consuming to design
  4182. and could be quite long.  It is possible to use the {\tt \\input}
  4183. command to use such a macro package, just as it is possible to
  4184. use it with your own macros.  But \TeX{} has a better facility
  4185. for larger packages.
  4186.  
  4187. A macro package can be put in a special form that can be quickly
  4188. read by \TeX\null.  This is called a {\sl format file}, and
  4189. the exact form is of technical interest only.  The important
  4190. thing is it allows \TeX{} to be run with many new control
  4191. sequences predefined. Certain commands called {\sl primitives\/}
  4192. are part of the definition of \TeX\null.
  4193.  
  4194. What we have described in this manual is sometimes called {\sl
  4195. plain \TeX\/}, and consists of the \TeX{} primitives plus a set
  4196. of macros in a format file (that is usually included in \TeX{}
  4197. automatically) called {\tt plain.fmt}. For the curious, any
  4198. control word can be viewed using {\tt \\show}.  The command {\tt
  4199. \\show\\centerline} will display
  4200. \beginliteral
  4201. > \centerline=macro:
  4202. #1->\line {\hss #1\hss }.
  4203. @endliteral
  4204. \noindent
  4205. on the screen and in the log file. You can use {\tt \\show} with
  4206. your own macros, too.  If you end up using several macro
  4207. packages, you can use the {\tt \\show} command to see if a
  4208. particular macro is defined.
  4209.  
  4210. Many computer \centre{}s have the \LaTeX{} macro package.  This
  4211. package allows the user to create an index, a table of contents,
  4212. and a bibliography automatically.  It also has the ability to
  4213. insert some elementary graphic figures such as circles, ovals,
  4214. lines, and arrows. \LaTeX{} also uses special predefined files
  4215. called {\sl style files\/} to set up
  4216. specific page parameters. Many different style files are
  4217. available; some journals will accept papers on a magnetic medium
  4218. for direct processing if they are prepared using \LaTeX{} and a
  4219. designated style file. It is not difficult to shift from \TeX{}
  4220. to \LaTeX\null. A user's guide by the author of the macro
  4221. package, Leslie Lamport, is available:
  4222. {\bf \LaTeX{}: A document preparation system}%
  4223. \fnote{Addison-Wesley, Reading, Massachusetts, 1986,
  4224. ISBN 0-201-15790-X.}.
  4225.  
  4226. The American Mathematical Society uses the \AMSTeX{} macro
  4227. package for its journals.  It is readily available from that
  4228. Society, and papers may be submitted to their journals on a
  4229. magnetic medium using \AMSTeX\null.  A manual by Michael Spivak,
  4230. {\bf The Joy of \TeX{}}\fnote{American Mathematical
  4231. Society, 1986, ISBN 0-8218-2999-8}, is available from the
  4232. American Mathematical Society.
  4233.  
  4234. Other macro packages exist, and undoubtedly more will be
  4235. developed. They are usually of modest cost and can be very
  4236. effective in some circumstances.  The \TeX{} Users Group
  4237. announces the existence of new macro packages in its
  4238. publications.
  4239.  
  4240. \subsection{Horizontal and vertical lines}
  4241.  
  4242. Making horizontal and vertical lines is easy using \TeX\null.
  4243. When typing in text, {\tt \\hrule } will cause the current
  4244. paragraph to end, will draw a horizontal line whose width is the
  4245. current value of {\tt \\hsize}, and then will continue on with a
  4246. new paragraph.  It's possible to specify the width of the hrule
  4247. as, for example, with {\tt \\hrule width 5 cm}; also you can use
  4248. {\tt \\vskip} or {\tt \\bigskip} to put some space above or below
  4249. the hrule.  Here is an example:
  4250.  
  4251. \beginuser
  4252. \\parindent = 0 pt \\parskip = 12 pt
  4253. Here is the text before the hrule.
  4254. \\bigskip
  4255. \\hrule width 3 in
  4256. And here is some text after the hrule.
  4257. \enduser
  4258.  
  4259. \noindent that produces
  4260. \vfill\eject
  4261.  
  4262. {
  4263. \parindent = 0 pt
  4264. Here is the text before the hrule.
  4265. \bigskip
  4266. \hrule width 3 in
  4267. And here is some text after the hrule.
  4268. }
  4269.  
  4270. In fact this hrule not only has width of three inches, but also
  4271. by default has a height (the amount by which the hrule extends
  4272. above the baseline on which the type is being set) of 0.4 points
  4273. and a depth (the amount by which the hrule extends below the
  4274. baseline on which the type is being set) of 0 points.  Each of
  4275. these parameters can be individually set.  Thus if we change the
  4276. last example to say
  4277.  
  4278. {\tt \\hrule width 3 in height 2 pt depth 3 pt } we get
  4279.  
  4280. {
  4281. \parindent = 0 pt
  4282. Here is the text before the hrule.
  4283. \bigskip
  4284. \hrule width 3 in height 2 pt depth 3 pt
  4285. And here is some text after the hrule.
  4286. }
  4287.  
  4288. The three parameters {\tt width}, {\tt height}, and {\tt depth} may
  4289. be given in any order.
  4290. \toindex{hrule}
  4291. \TeXref{221--222}
  4292.  
  4293. A vrule may be defined analogously to an hrule by specifying the
  4294. {\tt width}, {\tt height}, and {\tt depth} if desired.
  4295. \TeXref{221--222}
  4296. But, unlike the hrule, the vrule will not automatically start a
  4297. new paragraph when it appears.  By default the vrule will be 0.4
  4298. points wide, and will be as high as the line on which it is being
  4299. set. Hence
  4300.  
  4301. \toindex{vrule}
  4302.  
  4303. \beginuser
  4304. Here is some text before the vrule
  4305. \\vrule\\
  4306. and this follows the vrule.
  4307. \enduser
  4308.  
  4309. \noindent will give
  4310.  
  4311. Here is some text before the vrule
  4312. \vrule\
  4313. and this follows the vrule.
  4314.  
  4315. \exercise Make three horizontal lines that are 15 points apart,
  4316. 3 inches in length, and one inch in from the left margin.
  4317.  
  4318. Although we usually think of hrules and vrules as horizontal and
  4319. vertical lines, they need not necessarily be used that way.  For
  4320. example:
  4321.  
  4322. \beginuser
  4323. \\noindent
  4324. Name: \\vrule height 0 pt depth 0.4 pt width 3 in
  4325. \enduser
  4326.  
  4327. \noindent will give
  4328.  
  4329. \noindent
  4330. Name: \vrule height 0 pt depth 0.4 pt width 3 in
  4331.  
  4332. \exercise Make the following grid (each box is 1 \centimetre{} square):
  4333. \medskip
  4334. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  4335. \moveright 2 in
  4336. \vbox{
  4337. \hrule width 3 cm
  4338. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4339.   & \vrule height 1 cm \cr
  4340. \hrule width 3 cm
  4341. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4342.   & \vrule height 1 cm \cr
  4343. \hrule width 3 cm
  4344. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4345.   & \vrule height 1 cm \cr
  4346. \hrule width 3 cm
  4347. }
  4348.  
  4349.  
  4350. \subsection{Boxes within boxes}
  4351.  
  4352. We have already seen (in our discussion of line shapes) that
  4353. vboxes and hboxes are objects that may be overfull or underfull.
  4354. In this section we will look at these boxes in a bit more detail.
  4355. They may be stacked or lined up to allow a variety of positions
  4356. for text on the page.
  4357.  
  4358. An hbox is formed by using {\tt \\hbox\lb $\ldots$\rb}\null.
  4359. Once the material between the braces has been put into an hbox,
  4360. it is set and can not be further split (this means that material
  4361. that must go on one line can be put into an hbox, and it will
  4362. then remain as one unit).  It's possible to specify the size of
  4363. an hbox.\TeXref{64--66} Thus {\tt \\hbox to 5 cm\lb contents of
  4364. the box\rb } will produce an hbox exactly five \centimetre{}s
  4365. wide containing the typeset text ``contents of the box''.
  4366. It's easy to get an underfull or overfull box in this way. An
  4367. underfull box can be avoided by using {\tt \\hfil} to absorb the
  4368. extra space. When no dimension is given, an hbox is formed that
  4369. is just wide enough to hold the enclosed text.
  4370. \toindex{hbox}
  4371.  
  4372. Similarly, vboxes are formed using {\tt \\vbox\lb $\ldots$\rb}.
  4373. What makes these boxes interesting is that when a vbox contains
  4374. hboxes, these hboxes are stacked one above the other and set as a
  4375. unit. Similarly, an hbox can contain vboxes, which will be set in
  4376. a row. Suppose we take three hboxes and put them in a vbox:
  4377. \toindex{vbox}
  4378.  
  4379. \beginuser \obeyspaces
  4380. \\vbox\lb
  4381. \      \\hbox\lb{}Contents of box 1\rb
  4382. \      \\hbox\lb{}Contents of box 2\rb
  4383. \      \\hbox\lb{}Contents of box 3\rb
  4384. \      \rb
  4385. \enduser
  4386.  
  4387. \noindent gives
  4388. \vskip \baselineskip
  4389. \vbox{
  4390.       \hbox{Contents of box 1}
  4391.       \hbox{Contents of box 2}
  4392.       \hbox{Contents of box 3}
  4393.       }
  4394.  
  4395. Now suppose we take another vbox:
  4396.  
  4397. \beginuser \obeyspaces
  4398. \\vbox\lb
  4399. \      \\hbox\lb{}Contents of box 4\rb
  4400. \      \\hbox\lb{}Contents of box 5\rb
  4401. \      \rb
  4402. \enduser
  4403.  
  4404. These two vboxes can be put into an hbox; this will cause them to
  4405. be placed side by side. In other words
  4406.  
  4407. \beginuser \obeyspaces
  4408. \\hbox\lb
  4409. \     \\vbox\lb
  4410. \           \\hbox\lb{}Contents of box 1\rb
  4411. \           \\hbox\lb{}Contents of box 2\rb
  4412. \           \\hbox\lb{}Contents of box 3\rb
  4413. \           \rb
  4414. \     \\vbox\lb
  4415. \           \\hbox\lb{}Contents of box 4\rb
  4416. \           \\hbox\lb{}Contents of box 5\rb
  4417. \           \rb
  4418. \     \rb
  4419. \enduser
  4420.  
  4421. \noindent gives
  4422. \vskip \baselineskip
  4423. \hbox{
  4424.      \vbox{
  4425.            \hbox{Contents of box 1}
  4426.            \hbox{Contents of box 2}
  4427.            \hbox{Contents of box 3}
  4428.            }
  4429.      \vbox{
  4430.            \hbox{Contents of box 4}
  4431.            \hbox{Contents of box 5}
  4432.           }
  4433.      }
  4434.  
  4435.  
  4436. Notice that the two vboxes are aligned so that the bottoms are
  4437. level; also there is a little space at the beginning of each line
  4438. and also between the vboxes.  Actually, the reason these spaces
  4439. appear is rather subtle. Unless a line ends in a control word,
  4440. there is always a space between the last entry in one line and
  4441. the first one in the next line. For this reason the space between
  4442. the vboxes comes from the end of the line containing the closing
  4443. brace of the first vbox.  Similarly, the space at the beginning
  4444. of the line is caused by the space after the opening brace of the
  4445. hbox. These spaces can be avoided by ``commenting out'' the end of
  4446. the line, that is, by putting a {\tt \%} immediately after the
  4447. closing brace of the first vbox or the opening brace of the hbox.
  4448. If you try to put some vboxes together and accidentally get extra
  4449. space by forgetting to comment out the end of the line, you're in
  4450. good company.  Some very able and experienced \TeX{} users have
  4451. done the same thing!
  4452.  
  4453. Extra space, say one \centimetre,  can be added by putting an
  4454. {\tt \\hskip 1 cm } between the vboxes.  They can be aligned so
  4455. that the tops are level by using {\tt \\vtop } instead of
  4456. {\tt \\vbox}.  Making these two changes results in:
  4457.  
  4458. \toindex{vtop}
  4459. \vskip \baselineskip
  4460. \hbox{
  4461.      \vtop{
  4462.            \hbox{Contents of box 1}
  4463.            \hbox{Contents of box 2}
  4464.            \hbox{Contents of box 3}
  4465.            }
  4466.      \hskip 1 cm
  4467.      \vtop{
  4468.            \hbox{Contents of box 4}
  4469.            \hbox{Contents of box 5}
  4470.           }
  4471.      }
  4472.  
  4473.  
  4474. We can combine vboxes, hboxes, vrules, and hrules to get boxed
  4475. text.  How might we construct such a box? One way is to take the
  4476. material to be boxed and put it in an hbox preceded and followed
  4477. by a vrule.  Then put this in a vbox with hrules above and below
  4478. it. This gives us:
  4479.  
  4480. \beginuser \obeyspaces
  4481. \\vbox\lb
  4482. \      \\hrule
  4483. \      \\hbox\lb\\vrule{} The text to be boxed \\vrule\rb
  4484. \      \\hrule
  4485. \     \rb
  4486. \enduser
  4487.  
  4488. \noindent which results in
  4489. \vskip \baselineskip
  4490. \vbox{
  4491.       \hrule
  4492.       \hbox{\vrule{} The text to be boxed \vrule}
  4493.       \hrule
  4494.      }
  4495.  
  4496. This produces boxed material, but there is no margin around it
  4497. and so it looks very cramped (of course \TeX{} is just giving us
  4498. what we asked for).  We can improve the spacing by putting a {\tt
  4499. \\strut} at the beginning of the hbox to make it a little taller
  4500. and deeper.  This gives us:
  4501. \vskip \baselineskip
  4502. \vbox{
  4503.       \hrule
  4504.       \hbox{\strut \vrule{} The text to be boxed \vrule}
  4505.       \hrule
  4506.      }
  4507.  
  4508. \def\boxtext#1{%
  4509. \vbox{%
  4510.       \hrule
  4511.       \hbox{\strut \vrule{} #1 \vrule}%
  4512.       \hrule
  4513.      }%
  4514. }
  4515.  
  4516. \exercise Why is it that we were forced to add extra space above
  4517. and below the text but not before and after it?
  4518.  
  4519.  
  4520. \exercise Use the method of boxing material to put text \centred{}
  4521. in a box which extends from the left to the right margin.
  4522.  
  4523. \exercise By stacking nine little boxes, make the following magic square:
  4524. \vskip\baselineskip
  4525.  
  4526. \moveright 2 in \vbox{\offinterlineskip
  4527. \hbox{\boxtext 6\boxtext 1\boxtext 8}
  4528. \hbox{\boxtext 7\boxtext 5\boxtext 3}
  4529. \hbox{\boxtext 2\boxtext 9\boxtext 4}
  4530. }
  4531.  
  4532. \exercise Notice that the magic square in the previous exercise
  4533. has internal lines that are twice as thick as the outside ones.
  4534. Also, there is a tiny space at the intersection of the internal
  4535. lines. Fix up the magic square so this doesn't happen.
  4536.  
  4537. \def\boxtext#1 {%
  4538. \vbox{%
  4539.       \hrule
  4540.       \hbox{\strut \vrule #1\vrule}%
  4541.       \hrule
  4542.      }
  4543. }
  4544.  
  4545. \exercise Write a macro { \tt \\boxtext\#1\lb$\ldots$\rb } which
  4546. will take the text between the braces and put a box around it.  Test
  4547. your macro by making up a sentence with every other word boxed.
  4548. I'm \boxtext not quite \boxtext sure why \boxtext someone
  4549. would \boxtext do this \boxtext since the \boxtext result is \boxtext
  4550. pretty strange. Note how the baseline and the bottom of
  4551. the surrounding boxes align.
  4552.  
  4553. \def\boxtext#1 {%
  4554. \lower 3.5pt \hbox{%
  4555.     \vbox{%
  4556.          \hrule
  4557.          \hbox{\strut \vrule #1\vrule}%
  4558.          \hrule
  4559.         }
  4560.     }
  4561. }
  4562.  
  4563. It's easy to move boxes up, down, left, or right on the page. A
  4564. {\tt \\vbox} can be moved to the right one inch by using {\tt
  4565. \\moveright 1 in \\vbox\lb\dots\rb}.  To move it to the left,
  4566. use {\tt \\moveleft}.  Similarly, an {\tt \\hbox} can be moved up
  4567. or down using {\tt \\raise} or {\tt \\lower}.
  4568. \toindex{moveright}
  4569. \toindex{moveleft}
  4570. \toindex{raise}
  4571. \toindex{lower}
  4572.  
  4573. \exercise Rewrite the {\tt \\boxtext} macro from the previous
  4574. exercise so that all of the text is aligned (hint: by default the
  4575. depth of a strut is 3.5 points).  This would give a sentence like
  4576. the following: I'm \boxtext not quite \boxtext sure why \boxtext
  4577. someone would \boxtext do this \boxtext since the \boxtext result
  4578. is \boxtext pretty strange.
  4579.  
  4580. It's possible to fill a box with either an hrule or with dots.
  4581. The idea is to use {\tt \\hrulefill } or {\tt \\dotfill } in the
  4582. hbox.
  4583.  
  4584. \beginuser
  4585. \\hbox to 5 in\lb Getting Started\\hrulefill 1\rb
  4586. \\hbox to 5 in\lb All Characters Great and Small\\hrulefill 9\rb
  4587. \\hbox to 5 in\lb The Shape of Things to come\\hrulefill 17\rb
  4588. \\hbox to 5 in\lb No Math Anxiety Here!\\hrulefill 30\rb
  4589. \enduser
  4590.  
  4591. \noindent gives
  4592. \vskip \baselineskip
  4593.  
  4594. \hbox to 5 in{Getting Started\hrulefill 1}
  4595. \hbox to 5 in{All Characters Great and Small\hrulefill 9}
  4596. \hbox to 5 in{The Shape of Things to come\hrulefill 17}
  4597. \hbox to 5 in{No Math Anxiety Here!\hrulefill 30}
  4598.  
  4599. If {\tt \\hrulefill} is replaced by {\tt \\dotfill} we get
  4600. \vskip \baselineskip
  4601.  
  4602. \hbox to 5 in{Getting Started\dotfill 1}
  4603. \hbox to 5 in{All Characters Great and Small\dotfill 9}
  4604. \hbox to 5 in{The Shape of Things to come\dotfill 17}
  4605. \hbox to 5 in{No Math Anxiety Here!\dotfill 30}
  4606.  
  4607. \exercise Make a boxed headline appear at the top of the page
  4608. that is like the one used in this manual.
  4609.  
  4610.  
  4611.  
  4612. \section{Control word list}
  4613.  
  4614. Here is a list of the control words given in this manual.
  4615. If you want more detail about these words than is given here,
  4616. check the index of {\bf The \TeX book}.
  4617.  
  4618. \vskip 2\baselineskip
  4619. \centerline{Control symbols}
  4620. \vskip\baselineskip
  4621.  
  4622. \settabs \+ \hskip 1.5 in & \hskip 1.65in & \hskip 1.3in & \cr
  4623. {\tt
  4624. \+  \\\sp{} 4 & \\!\ 34  & \\" 11 & \\' 11    \cr
  4625. \+  \\, 34    & \\.\ 11  & \\/ 16 & \\; 34    \cr
  4626. \+  \\= 11    & \\> 34   & \\\# 10&  \\\$ 6  \cr
  4627. \+  \\\% 6    & \\\& 10   & \\\char '173{} 10  & \\\char '175{} 10 \cr
  4628. \+  \\\underbar{ } 10 & \\` 11 & \\{\accent "7E } 10 & \\{\accent 94 } 10 \cr
  4629. \+  \\| 40 \cr
  4630. }
  4631.  
  4632. \vskip 2\baselineskip
  4633. \centerline{Control words}
  4634. \vskip\baselineskip
  4635.  
  4636. {\tt
  4637. \+ \\AA 12 & \\aa 12 & \\acute 36 & \\AE 12 \cr
  4638. \+ \\ae 12 & \\aleph 37 & \\alpha 35 & \\angle 37 \cr
  4639. \+ \\approx 37 & \\arccos 41 & \\arcsin 41 & \\arctan 41 \cr
  4640. \+ \\arg 41 & \\ast 36 & \\b 12 & \\backslash 37 \cr
  4641. \+ \\bar 36 & \\baselineskip 22 & \\beta 35 & \\bf 16 \cr
  4642. \+ \\biggl 40 & \\Biggl 40 & \\biggr 40 & \\Biggr 40 \cr
  4643. \+ \\bigl 40 & \\Bigl 40 & \\bigr 40 & \\Bigr 40 \cr
  4644. \+ \\bigskip 26 & \\break 26 & \\breve 36 & \\bullet 36 \cr
  4645. \+ \\bye 4 & \\c 12 & \\cap 36 & \\cdot 36 \cr
  4646. \+ \\centerline 26 & \\centreline 60 & \\check 36 & \\chi 35 \cr
  4647. \+ \\circ 35 & \\columns 48 & \\cos 41 & \\cosh 41 \cr
  4648. \+ \\cot 41 & \\coth 41 & \\csc 41& \\cup 36 \cr
  4649. \+ \\d 12 & \\ddag 27 & \\ddot 36 & \\def 55 \cr
  4650. \+ \\deg 41 & \\delta 35 & \\Delta 35 & \\det 41 \cr
  4651. \+ \\diamond 36 & \\dim 41 & \\div 36 & \\dot 36 \cr
  4652. \+ \\dotfill 49 & \\dots 14 & \\downarrow 41 & \\Downarrow 41 \cr
  4653. \+ \\eject 20 & \\ell 37 & \\endinsert 26 & \\epsilon 35 \cr
  4654. \+ \\eqalign 45 & \\eqalignno 46 & \\eqno 46 & \\equiv 37 \cr
  4655. \+ \\eta 35 & \\exists 37 & \\exp 41 & \\flat 37 \cr
  4656. \+ \\folio 28 & \\font 16 & \\footline 28 & \\footnote 27 \cr
  4657. \+ \\forall 37 & \\gamma 35 & \\Gamma 35 & \\gcd 41 \cr
  4658. \+ \\geq 37 & \\grave 36 & \\H 12 & \\halign 51 \cr
  4659. \+ \\hang 23 & \\hangafter 23 & \\hangindent 23 & \\hat 36 \cr
  4660. \+ \\hbadness 29 & \\hbox 72 & \\headline 28 & \\hfil 27 \cr
  4661. \+ \\hfill 26 & \\hfuzz 29 & \\hoffset 20 & \\hom 41 \cr
  4662. \+ \\hrule 71 & \\hrulefill 49 & \\hsize 20 & \\hskip 27 \cr
  4663. \+ \\hyphenation 30 & \\i 11 & \\Im 37 & \\in 37 \cr
  4664. \+ \\inf 41 & \\infty 37 & \\input 68 & \\int 38 \cr
  4665. \+ \\iota 35 & \\it 16 & \\item 24 & \\itemitem 24 \cr
  4666. \+ \\j 11 & \\kappa 35 & \\ker 41 & \\L 12 \cr
  4667. \+ \\l 12 &  \\lambda 35 & \\Lambda 35 & \\langle 41 \cr
  4668. \+ \\lceil 41 &  \\left 44 & \\leftline 26 & \\leftskip 23 \cr
  4669. \+ \\leq 37 &  \\leqalignno 46 & \\leqno 46 & \\let 61 \cr
  4670. \+ \\lfloor 41 &  \\lg 41 & \\lim 38 & \\liminf 41 \cr
  4671. \+ \\limsup 41 &  \\line 26 & \\ln 41 & \\log 41 \cr
  4672. \+ \\lower 75 &  \\magnification 21 & \\magstep 16 & \\matrix 44 \cr
  4673. \+ \\max 41 &  \\medskip 26 & \\min 41 & \\moveleft 75 \cr
  4674. \+ \\moveright 75 &  \\mu 35 & \\nabla 37 & \\narrower 23 \cr
  4675. \+ \\natural 37 &  \\neg 37 & \\ni 37 & \\noalign 52 \cr
  4676. \+ \\noindent 22 &  \\nopagenumbers 5 & \\not 36 & \\nu 35 \cr
  4677. \+ \\O 12 &  \\o 12 & \\odot 36 & \\OE 12 \cr
  4678. \+ \\oe 12 &  \\offinterlineskip 53 & \\omega 35 & \\Omega 35 \cr
  4679. \+ \\ominus 36 &  \\oplus 36 & \\otimes 36 & \\over 37 \cr
  4680. \+ \\overfullrule 29 &  \\overline 39 & \\P 27 & \\pageno 28 \cr
  4681. \+ \\par 7 &  \\parallel 37 & \\parindent 23 & \\parshape 24 \cr
  4682. \+ \\parskip 22 &  \\partial 37 & \\perp 37 & \\phi 35 \cr
  4683. \+ \\Phi 35 &  \\pi 35 & \\Pi 35 & \\pmatrix 43 \cr
  4684. \+ \\Pr 41 &  \\proclaim 42 & \\psi 35 & \\Psi 35 \cr
  4685. \+ \\qquad 34 &  \\quad 34 & \\raggedright 27 & \\raise 75 \cr
  4686. \+ \\rangle 41 &  \\rceil 41 & \\Re 37 & \\rfloor 41 \cr
  4687. \+ \\rho 35 &  \\right 44 & \\rightline 26 & \\rightskip 23 \cr
  4688. \+ \\rm 16 &  \\root 39 & \\S 27 & scaled 16 \cr
  4689. \+ \\sec 41 &  \\settabs 48 & \\sharp 37 & \\sigma 35 \cr
  4690. \+ \\Sigma 35 &  \\sim 37 & \\simeq 37 & \\sin 41 \cr
  4691. \+ \\sinh 41 &  \\sl 16 & \\smallskip 26 & \\sqroot 39 \cr
  4692. \+ \\ss 12 &  \\star 36 & \\strut 50 & \\subset 37 \cr
  4693. \+ \\subseteq 37 &  \\sum 38 & \\sup 41 & \\supset 37 \cr
  4694. \+ \\supseteq 37 &  \\surd 39 & \\t 12 & \\tan 41 \cr
  4695. \+ \\tanh 41 &  \\tau 35 & \\tensor 60 & \\TeX{} 5 \cr
  4696. \+ \\tensor 60 &  \\the 28 & \\theta 35 & \\Theta 35 \cr
  4697. \+ \\tilde 36 &  \\times 36 & \\tolerance 29  & \\topinsert 26 \cr
  4698. \+ \\tt 16 &  \\u 12 & \\underbar 39 & \\underline 39 \cr
  4699. \+ \\uparrow 41 &  \\Uparrow 41 & \\updownarrow 41 & \\Updownarrow 41 \cr
  4700. \+ \\upsilon 35 &  \\Upsilon 35 & \\v 12 & \\varepsilon 35 \cr
  4701. \+ \\varphi 35 &  \\varrho 35 & \\varsigma 35 & \\vartheta 35 \cr
  4702. \+ \\vbadness 30 &  \\vbox 71 & \\vec 36 & \\vee 36 \cr
  4703. \+ \\vfill 20 &  \\vglue 25 & \\voffset 20 & \\vrule 71 \cr
  4704. \+ \\vsize 20 & \\vtop 74 &  \\wedge 36 & \\widehat 36 \cr
  4705. \+ \\widetilde 36 & \\xi 35 &  \\Xi 35 & \\zeta 35 \cr
  4706. }
  4707.  
  4708. \ifwritinganswers
  4709.    \let\next=\relax
  4710. \else
  4711.    \let\next=\endinput
  4712.    \datestamp
  4713. \fi
  4714.  
  4715. \next
  4716.  
  4717. \def\beginliteral{
  4718. \vskip\baselineskip
  4719. \begingroup
  4720. \obeylines
  4721. \tt
  4722. \catcode`\@=0\catcode`\~=12
  4723. \catcode`\$=12\catcode`\&=12\catcode`\^=12\catcode`\#=12
  4724. \catcode`\_=12\catcode`\=12
  4725. \def\par{\leavevmode\endgraf}
  4726. \catcode`\{=12\catcode`\}=12\catcode`\%=12\catcode`\\=12
  4727.  
  4728. }
  4729. \def\endliteral{\nobreak \vskip 6pt \endgroup}
  4730.  
  4731.  
  4732. \section{I get by with a little help}
  4733. Many of the exercises can be answered in several ways. If you
  4734. like your way better than the way given below, by all means use
  4735. it!
  4736. \vskip 2\baselineskip
  4737.  
  4738. \parskip=0pt \parindent=0pt
  4739. \raggedright
  4740. \hbadness=10000
  4741.  
  4742. \hrule
  4743. \beginliteral
  4744. I like \TeX!
  4745. Once you get the hang of it, \TeX\  is really easy to use.
  4746. You just have to master the \TeX nical aspects.
  4747. @endliteral
  4748. I like \TeX! Once you get the hang of it, \TeX\  is really easy
  4749. to use. You just have to master the \TeX nical aspects.
  4750. \vskip \baselineskip \hrule
  4751.  
  4752.  
  4753. \goodbreak \vskip 2pt \hrule
  4754. \beginliteral
  4755. Does \AE schylus understand \OE dipus?
  4756. @endliteral
  4757. Does \AE schylus understand \OE dipus?
  4758. \vskip \baselineskip \hrule
  4759.  
  4760. \goodbreak \vskip 2pt \hrule
  4761. \beginliteral
  4762. The smallest internal unit of \TeX{} is about 53.63\AA.
  4763. @endliteral
  4764. The smallest internal unit of \TeX{} is about 53.63\AA.
  4765. \vskip \baselineskip \hrule
  4766.  
  4767.  
  4768. \goodbreak \vskip 2pt \hrule
  4769. \beginliteral
  4770.  They took some honey and plenty of money wrapped up in a {\it \$}5 note.
  4771. @endliteral
  4772.  They took some honey and plenty of money wrapped up in a {\it \$}5 note.
  4773. \vskip \baselineskip \hrule
  4774.  
  4775.  
  4776. \goodbreak \vskip 2pt \hrule
  4777. \beginliteral
  4778.  \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  4779. @endliteral
  4780.  \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  4781. \vskip \baselineskip \hrule
  4782.  
  4783.  
  4784. \goodbreak \vskip 2pt \hrule
  4785. \beginliteral
  4786.  Za\v sto tako polako pijete \v caj?
  4787. @endliteral
  4788.  Za\v sto tako polako pijete \v caj?
  4789. \vskip \baselineskip \hrule
  4790.  
  4791.  
  4792. \goodbreak \vskip 2pt \hrule
  4793. \beginliteral
  4794.  Mein Tee ist hei\ss.
  4795. @endliteral
  4796.  Mein Tee ist hei\ss.
  4797. \vskip \baselineskip \hrule
  4798.  
  4799.  
  4800. \goodbreak \vskip 2pt \hrule
  4801. \beginliteral
  4802.  Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  4803. @endliteral
  4804.  Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  4805. \vskip \baselineskip \hrule
  4806.  
  4807. \goodbreak \vskip 2pt \hrule
  4808. \def\`{\relax\lq}
  4809. \beginliteral
  4810. ?@`Por qu\'e no bebes vino blanco? !@`Porque est\'a avinagrado!
  4811. @endliteral
  4812. ?`Por qu\'e no bebes vino blanco? !`Porque est\'a avinagrado!
  4813. \vskip \baselineskip \hrule
  4814.  
  4815. \goodbreak \vskip 2pt \hrule
  4816. \beginliteral
  4817.  M\'\i\'\j n idee\"en worden niet be\"\i nvloed.
  4818. @endliteral
  4819.  M\'\i\'\j n idee\"en worden niet be\"\i nvloed.
  4820. \vskip \baselineskip \hrule
  4821.  
  4822.  
  4823.  
  4824. \goodbreak \vskip 2pt \hrule
  4825. \beginliteral
  4826.  Can you take a ferry from \"Oland to \AA land?
  4827. @endliteral
  4828.  Can you take a ferry from \"Oland to \AA land?
  4829. \vskip \baselineskip \hrule
  4830.  
  4831.  
  4832. \goodbreak \vskip 2pt \hrule
  4833. \beginliteral
  4834.  T\"urk\c ce konu\c san ye\u genler nasillar?
  4835. @endliteral
  4836.  T\"urk\c ce konu\c san ye\u genler nasillar?
  4837. \vskip \baselineskip \hrule
  4838.  
  4839.  
  4840.  
  4841.  
  4842. \goodbreak \vskip 2pt \hrule
  4843. \beginliteral
  4844.  I entered the room and---horrors---I saw both my father-in-law and my
  4845. mother-in-law.
  4846. @endliteral
  4847.  I entered the room and---horrors---I saw both my father-in-law and my
  4848. mother-in-law.
  4849. \vskip \baselineskip \hrule
  4850.  
  4851.  
  4852. \goodbreak \vskip 2pt \hrule
  4853. \beginliteral
  4854. The winter of 1484--1485 was one of discontent.
  4855. @endliteral
  4856. The winter of 1484--1485 was one of discontent.
  4857. \vskip \baselineskip \hrule
  4858.  
  4859.  
  4860. \goodbreak \vskip 2pt \hrule
  4861. \beginliteral
  4862. His ``thoughtfulness'' was impressive.
  4863. @endliteral
  4864. His ``thoughtfulness'' was impressive.
  4865. \vskip \baselineskip \hrule
  4866.  
  4867.  
  4868. \goodbreak \vskip 2pt \hrule
  4869. \beginliteral
  4870.  Frank wondered, ``Is this a girl that can't say `No!'?''
  4871. @endliteral
  4872.  Frank wondered, ``Is this a girl that can't say `No!'?''
  4873. \vskip \baselineskip \hrule
  4874.  
  4875.  
  4876. \goodbreak \vskip 2pt \hrule
  4877. \beginliteral
  4878.  He thought, ``\dots and this goes on forever, perhaps to the last recorded
  4879. syllable.''
  4880. @endliteral
  4881.  He thought, ``\dots and this goes on forever, perhaps to the last recorded
  4882. syllable.''
  4883. \vskip \baselineskip \hrule
  4884.  
  4885.  
  4886. \goodbreak \vskip 2pt \hrule
  4887. \beginliteral
  4888.  Have you seen Ms.~Jones?
  4889. @endliteral
  4890.  Have you seen Ms.~Jones?
  4891. \vskip \baselineskip \hrule
  4892.  
  4893.  
  4894. \goodbreak \vskip 2pt \hrule
  4895. \beginliteral
  4896. Prof.~Smith and Dr.~Gold flew from
  4897. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  4898. @endliteral
  4899. Prof.~Smith and Dr.~Gold flew from
  4900. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  4901. \vskip \baselineskip \hrule
  4902.  
  4903.  
  4904. \goodbreak \vskip 2pt \hrule
  4905. \beginliteral
  4906. \line{left end \hfil left tackle \hfil left guard \hfil @centre \hfil
  4907. right guard \hfil right tackle \hfil right end}
  4908. @endliteral
  4909. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil
  4910. right guard \hfil right tackle \hfil right end}
  4911. \vskip \baselineskip \hrule
  4912.  
  4913.  
  4914. \goodbreak \vskip 2pt \hrule
  4915. \beginliteral
  4916. \line{left \hfil \hfil right-@centre \hfil right}
  4917. @endliteral
  4918. \line{left \hfil \hfil right-\centre{} \hfil right}
  4919. \vskip \baselineskip \hrule
  4920.  
  4921.  
  4922. \goodbreak \vskip 2pt \hrule
  4923. \beginliteral
  4924. \line{\hskip 1 in ONE \hfil TWO \hfil THREE}
  4925. @endliteral
  4926. \line{\hskip 1 in ONE \hfil TWO \hfil THREE}
  4927. \vskip \baselineskip \hrule
  4928.  
  4929.  
  4930. \goodbreak \vskip 2pt \hrule
  4931. \beginliteral
  4932. i{f}f if{}f if{f}
  4933. @endliteral
  4934. i{f}f if{}f if{f}
  4935. \vskip \baselineskip \hrule
  4936.  
  4937.  
  4938. \goodbreak \vskip 2pt \hrule
  4939. \beginliteral
  4940. I started with roman type {\it switched to italic type}, and
  4941. returned to roman type.
  4942. @endliteral
  4943. I started with roman type {\it switched to italic type}, and
  4944. returned to roman type.
  4945. \vskip \baselineskip \hrule
  4946.  
  4947.  
  4948. \goodbreak \vskip 2pt \hrule
  4949. \beginliteral
  4950. $C(n,r) = n!/(r!\,(n-r)!)$
  4951. @endliteral
  4952. $C(n,r) = n!/(r!\,(n-r)!)$
  4953. \vskip \baselineskip \hrule
  4954.  
  4955.  
  4956. \goodbreak \vskip 2pt \hrule
  4957. \beginliteral
  4958. $a+b=c-d=xy=w/z$
  4959. $$a+b=c-d=xy=w/z$$
  4960. @endliteral
  4961. $a+b=c-d=xy=w/z$
  4962. $$a+b=c-d=xy=w/z$$
  4963. \vskip \baselineskip \hrule
  4964.  
  4965.  
  4966. \goodbreak \vskip 2pt \hrule
  4967. \beginliteral
  4968. $(fg)' = f'g + fg'$
  4969. $$(fg)' = f'g + fg'$$
  4970. @endliteral
  4971. $(fg)' = f'g + fg'$
  4972. $$(fg)' = f'g + fg'$$
  4973. \vskip \baselineskip \hrule
  4974.  
  4975.  
  4976. \goodbreak \vskip 2pt \hrule
  4977. \beginliteral
  4978. $\alpha\beta=\gamma+\delta$
  4979. $$\alpha\beta=\gamma+\delta$$
  4980. @endliteral
  4981. $\alpha\beta=\gamma+\delta$
  4982. $$\alpha\beta=\gamma+\delta$$
  4983. \vskip \baselineskip \hrule
  4984.  
  4985.  
  4986. \goodbreak \vskip 2pt \hrule
  4987. \beginliteral
  4988. $\Gamma(n) = (n-1)!$
  4989. $$\Gamma(n) = (n-1)!$$
  4990. @endliteral
  4991. $\Gamma(n) = (n-1)!$
  4992. $$\Gamma(n) = (n-1)!$$
  4993. \vskip \baselineskip \hrule
  4994.  
  4995. \goodbreak \vskip 2pt \hrule
  4996. \beginliteral
  4997. $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$
  4998. @endliteral
  4999. $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$
  5000. \vskip \baselineskip \hrule
  5001.  
  5002. \goodbreak \vskip 2pt \hrule
  5003. \beginliteral
  5004. $2+4+6+\cdots +2n = n(n+1)$
  5005. @endliteral
  5006. $2+4+6+\cdots +2n = n(n+1)$
  5007. \vskip \baselineskip \hrule
  5008.  
  5009.  
  5010. \goodbreak \vskip 2pt \hrule
  5011. \beginliteral
  5012. $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  5013. @endliteral
  5014. $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  5015. \vskip \baselineskip \hrule
  5016.  
  5017.  
  5018. \goodbreak \vskip 2pt \hrule
  5019. \beginliteral
  5020. $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  5021. @endliteral
  5022. $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  5023. \vskip \baselineskip \hrule
  5024.  
  5025.  
  5026. \goodbreak \vskip 2pt \hrule
  5027. \beginliteral
  5028. $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  5029. @endliteral
  5030. $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  5031. \vskip \baselineskip \hrule
  5032.  
  5033.  
  5034. \goodbreak \vskip 2pt \hrule
  5035. \beginliteral
  5036. ${a+b\over c}\quad {a\over b+c}\quad {1\over a+b+c} \not= {1\over a}+
  5037. {1\over b}+{1\over c}$.
  5038. @endliteral
  5039. ${a+b\over c}\quad {a\over b+c}\quad {1\over a+b+c} \not= {1\over a}+
  5040. {1\over b}+{1\over c}$.
  5041. \vskip \baselineskip \hrule
  5042.  
  5043.  
  5044. \goodbreak \vskip 2pt \hrule
  5045. \beginliteral
  5046. What are the points where ${\partial \over \partial x} f(x,y) = {\partial \over
  5047. \partial y} f(x,y) = 0$?
  5048. @endliteral
  5049. What are the points where ${\partial \over \partial x} f(x,y) = {\partial \over
  5050. \partial y} f(x,y) = 0$?
  5051. \vskip \baselineskip \hrule
  5052.  
  5053.  
  5054. \goodbreak \vskip 2pt \hrule
  5055. \beginliteral
  5056. $e^x \quad e^{-x} \quad e^{i\pi}+1=0 \quad x_0 \quad x_0^2
  5057. \quad {x_0}^2 \quad 2^{x^x}$.
  5058. @endliteral
  5059. $e^x \quad e^{-x} \quad e^{i\pi}+1=0 \quad x_0 \quad x_0^2
  5060. \quad {x_0}^2 \quad 2^{x^x}$.
  5061. \vskip \baselineskip \hrule
  5062.  
  5063.  
  5064. \goodbreak \vskip 2pt \hrule
  5065. \beginliteral
  5066. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}+ {\partial^2 f \over
  5067. \partial y^2}$.
  5068. @endliteral
  5069. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}+ {\partial^2 f \over
  5070. \partial y^2}$.
  5071. \vskip \baselineskip \hrule
  5072.  
  5073.  
  5074. \goodbreak \vskip 2pt \hrule
  5075. \beginliteral
  5076. $\lim_{x\to 0} (1+x)^{1\over x}=e$.
  5077. @endliteral
  5078. $\lim_{x\to 0} (1+x)^{1\over x}=e$.
  5079. \vskip \baselineskip \hrule
  5080.  
  5081.  
  5082. \goodbreak \vskip 2pt \hrule
  5083. \beginliteral
  5084. The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  5085. @endliteral
  5086. The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  5087. \vskip \baselineskip \hrule
  5088.  
  5089.  
  5090. \goodbreak \vskip 2pt \hrule
  5091. \beginliteral
  5092. $\lim_{x\to {0^+}} x^x = 1$.
  5093. @endliteral
  5094. $\lim_{x\to {0^+}} x^x = 1$.
  5095. \vskip \baselineskip \hrule
  5096.  
  5097.  
  5098. \goodbreak \vskip 2pt \hrule
  5099. \beginliteral
  5100. $\int_0^1 3x^2\,dx = 1$.
  5101. @endliteral
  5102. $\int_0^1 3x^2\,dx = 1$.
  5103. \vskip \baselineskip \hrule
  5104.  
  5105.  
  5106. \goodbreak \vskip 2pt \hrule
  5107. \beginliteral
  5108. $\sqrt2 \quad \sqrt {x+y\over x-y} \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  5109. @endliteral
  5110. $\sqrt2 \quad \sqrt {x+y\over x-y} \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  5111. \vskip \baselineskip \hrule
  5112.  
  5113.  
  5114. \goodbreak \vskip 2pt \hrule
  5115. \beginliteral
  5116. $\|x\| = \sqrt{x\cdot x}$.
  5117. @endliteral
  5118. $\|x\| = \sqrt{x\cdot x}$.
  5119. \vskip \baselineskip \hrule
  5120.  
  5121.  
  5122. \goodbreak \vskip 2pt \hrule
  5123. \beginliteral
  5124. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  5125. @endliteral
  5126. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  5127. \vskip \baselineskip \hrule
  5128.  
  5129.  
  5130. \goodbreak \vskip 2pt \hrule
  5131. \beginliteral
  5132. $\underline x \quad \overline y \quad \underline{\overline{x+y}}$.
  5133. @endliteral
  5134. $\underline x \quad \overline y \quad \underline{\overline{x+y}}$.
  5135. \vskip \baselineskip \hrule
  5136.  
  5137.  
  5138. \goodbreak \vskip 2pt \hrule
  5139. \beginliteral
  5140. $\bigl \lceil \lfloor x \rfloor \bigr \rceil \leq \bigl \lfloor \lceil x \rceil
  5141. \bigr \rfloor$.
  5142. @endliteral
  5143. $\bigl \lceil \lfloor x \rfloor \bigr \rceil \leq \bigl \lfloor \lceil x \rceil
  5144. \bigr \rfloor$.
  5145. \vskip \baselineskip \hrule
  5146.  
  5147.  
  5148. \goodbreak \vskip 2pt \hrule
  5149. \beginliteral
  5150. $\sin(2\theta) = 2\sin\theta\cos\theta
  5151. \quad \cos(2\theta) = 2\cos^2\theta - 1  $.
  5152. @endliteral
  5153. $\sin(2\theta) = 2\sin\theta\cos\theta
  5154. \quad \cos(2\theta) = 2\cos^2\theta - 1  $.
  5155. \vskip \baselineskip \hrule
  5156.  
  5157.  
  5158. \goodbreak \vskip 2pt \hrule
  5159. \beginliteral
  5160. $$\int \csc^2x\, dx = -\cot x+ C
  5161. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  5162. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  5163. @endliteral
  5164. $$\int \csc^2x\, dx = -\cot x+ C
  5165. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  5166. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  5167. \vskip \baselineskip \hrule
  5168.  
  5169.  
  5170. \goodbreak \vskip 2pt \hrule
  5171. \beginliteral
  5172. $$\tan(2\theta) = {2\tan\theta \over 1-\tan^2\theta}.$$
  5173. @endliteral
  5174. $$\tan(2\theta) = {2\tan\theta \over 1-\tan^2\theta}.$$
  5175. \vskip \baselineskip \hrule
  5176.  
  5177.  
  5178. \goodbreak \vskip 2pt \hrule
  5179. \beginliteral
  5180. \proclaim Theorem (Euclid). There exist an infinite number of primes.
  5181. @endliteral
  5182. \proclaim Theorem (Euclid). There exist an infinite number of primes.
  5183.  
  5184. \vskip \baselineskip \hrule
  5185.  
  5186.  
  5187. \goodbreak \vskip 2pt \hrule
  5188. \beginliteral
  5189. \proclaim Proposition 1.
  5190. $\root n \of {\prod_{i=1}^n X_i} \leq
  5191. {1 \over n} \sum_{i=1}^n X_i$ with equality if and only if $X_1=\cdots=X_n$.
  5192. @endliteral
  5193. \proclaim Proposition 1.
  5194. $\root n \of {\prod_{i=1}^n X_i} \leq
  5195. {1 \over n} \sum_{i=1}^n X_i$ with equality if and only if $X_1=\cdots=X_n$.
  5196.  
  5197. \vskip \baselineskip \hrule
  5198.  
  5199.  
  5200.  
  5201. \goodbreak \vskip 2pt \hrule
  5202. \beginliteral
  5203. $$ I_4 = \pmatrix{
  5204. 1 &0 &0 &0 \cr
  5205. 0 &1 &0 &0 \cr
  5206. 0 &0 &1 &0 \cr
  5207. 0 &0 &0 &1 \cr}$$
  5208. @endliteral
  5209. $$ I_4 = \pmatrix{
  5210. 1 &0 &0 &0 \cr
  5211. 0 &1 &0 &0 \cr
  5212. 0 &0 &1 &0 \cr
  5213. 0 &0 &0 &1 \cr}$$
  5214. \vskip \baselineskip \hrule
  5215.  
  5216.  
  5217. \goodbreak \vskip 2pt \hrule
  5218. \beginliteral
  5219. $$ |x| = \left\{ \matrix{
  5220. x & x \ge 0 \cr
  5221. -x & x \le 0 \cr} \right.$$
  5222. @endliteral
  5223. $$ |x| = \left\{ \matrix{
  5224. x & x \ge 0 \cr
  5225. -x & x \le 0 \cr} \right.$$
  5226. \vskip \baselineskip \hrule
  5227.  
  5228. \goodbreak \vskip 2pt \hrule
  5229. \beginliteral
  5230. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  5231. \+ &Plums &\hfill\$1&.22 \cr
  5232. \+ &Coffee &\hfill1&.78 \cr
  5233. \+ &Granola &\hfill1&.98 \cr
  5234. \+ &Mushrooms & &.63 \cr
  5235. \+ &{Kiwi fruit} & &.39 \cr
  5236. \+ &{Orange juice} &\hfill1&.09 \cr
  5237. \+ &Tuna &\hfill1&.29 \cr
  5238. \+ &Zucchini & &.64 \cr
  5239. \+ &Grapes &\hfill1&.69 \cr
  5240. \+ &{Smoked beef} & &.75 \cr
  5241. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  5242. \+ &Total &\hfill \$12&.55 \cr
  5243. @endliteral
  5244. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  5245. \+ &Plums &\hfill\$1&.22 \cr
  5246. \+ &Coffee &\hfill1&.78 \cr
  5247. \+ &Granola &\hfill1&.98 \cr
  5248. \+ &Mushrooms & &.63 \cr
  5249. \+ &{Kiwi fruit} & &.39 \cr
  5250. \+ &{Orange juice} &\hfill1&.09 \cr
  5251. \+ &Tuna &\hfill1&.29 \cr
  5252. \+ &Zucchini & &.64 \cr
  5253. \+ &Grapes &\hfill1&.69 \cr
  5254. \+ &{Smoked beef} & &.75 \cr
  5255. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  5256. \+ &Total &\hfill \$12&.55 \cr
  5257. \vskip \baselineskip \hrule
  5258.  
  5259.  
  5260. \goodbreak \vskip 2pt \hrule
  5261. \beginliteral
  5262. \settabs \+ \hskip 4.5 in & \cr
  5263. \+Getting Started \dotfill &1 \cr
  5264. \+All Characters Great and Small \dotfill &9 \cr
  5265. @endliteral
  5266. \settabs \+ \hskip 4.5 in & \cr
  5267. \+Getting Started \dotfill &1 \cr
  5268. \+All Characters Great and Small \dotfill &9 \cr
  5269. \vskip \baselineskip \hrule
  5270.  
  5271. \goodbreak \vskip 2pt \hrule
  5272. \beginliteral
  5273. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  5274. \moveright 2 in
  5275. \vbox{
  5276. \hrule width 3 cm
  5277. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5278.   & \vrule height 1 cm \cr
  5279. \hrule width 3 cm
  5280. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5281.   & \vrule height 1 cm \cr
  5282. \hrule width 3 cm
  5283. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5284.   & \vrule height 1 cm \cr
  5285. \hrule width 3 cm
  5286. }
  5287. @endliteral
  5288. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  5289. \moveright 2 in
  5290. \vbox{
  5291. \hrule width 3 cm
  5292. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5293.   & \vrule height 1 cm \cr
  5294. \hrule width 3 cm
  5295. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5296.   & \vrule height 1 cm \cr
  5297. \hrule width 3 cm
  5298. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5299.   & \vrule height 1 cm \cr
  5300. \hrule width 3 cm
  5301. }
  5302. \vskip \baselineskip \hrule
  5303.  
  5304.  
  5305. \goodbreak \vskip 2pt \hrule
  5306. \beginliteral
  5307. \def\boxtext#1{%
  5308. \vbox{%
  5309.       \hrule
  5310.       \hbox{\strut \vrule{} #1 \vrule}%
  5311.       \hrule
  5312.      }%
  5313. }
  5314. \moveright 2 in \vbox{\offinterlineskip
  5315. \hbox{\boxtext{6}\boxtext{1}\boxtext {8}}
  5316. \hbox{\boxtext{7}\boxtext{5}\boxtext{3}}
  5317. \hbox{\boxtext{2}\boxtext{9}\boxtext{4}}
  5318. }
  5319. @endliteral
  5320. \def\boxtext#1{%
  5321. \vbox{%
  5322.       \hrule
  5323.       \hbox{\strut \vrule{} #1 \vrule}%
  5324.       \hrule
  5325.      }%
  5326. }
  5327. \moveright 2 in \vbox{\offinterlineskip
  5328. \hbox{\boxtext 6\boxtext 1\boxtext 8}
  5329. \hbox{\boxtext 7\boxtext 5\boxtext 3}
  5330. \hbox{\boxtext 2\boxtext 9\boxtext 4}
  5331. }
  5332. \vskip \baselineskip \hrule
  5333.  
  5334.  
  5335. \vfill
  5336. \datestamp
  5337.  
  5338. \bye
  5339.